One set has an IService interface implemented by the ServiceImpl class:
public interface IService { void doSomething(); } @Component @Provides @Instantiate public class ServiceImpl implements IService { public void doSomething() { } }
In the second package, I have another class: ServiceConsumer (GoGo shell command, specific annotations are not included) using the service provided in the first package:
@Component @Provides @Instantiate public class ServiceConsumer { @Requires private IService service; public doIt() { service.doSomething(); } }
When I import and run two packages in Felix, I see that all my services are correctly created using ipojo: instances, and that ServiceImpl provides an IService. However, when doIt () is executed, the service is null.
Since IService is apparently available, I would expect @Requires to introduce a good instance, but it doesn't seem to do that.
I have a feeling that I see something very obvious, but I have no idea what.
source share