@reference returns null.
Hello,
I have created service say XX. I tried to access that service XX in other Service YY.
When I try to use the XX like
@Reference XX xx in YY service
I got a null value.
Code:
@Component(immediate = true)
@Service(value = XX.class)
public class XX{
//some methods
}
@Component(immediate =true)
@Service(value=ZZ.class)
public class YY implements ZZ{
@Reference
XX xx;
public SB aa(String ss) {
LOG.info(xx);//Null
}
When I access my service in my servlet, It is working fine..
like
@Component(immediate = true)
@Service(javax.servlet.Filter.class)
public class FilterManager implements Filter {
@Reference
XX xx;
LOG.info(xx);//I can get an object here
}
Kindly guide me, Is it possible to access service inside other service?
Note:
In Felix console, can I see the service is active for both XX, YY.
Thanks
Nanda