Hello,
I have a codebase in AEM6.5 that cannot read a OSGi config, using org.osgi.service.cm.ConfigurationAdmin api, when @OSGIService is used instead of @reference.
I see that when annotated with @OSGIService, the reference object is not empty, but the Config is always returned as NULL, though they are confirmed to exist.
The same code works when used with @reference annotation & on other codebase the config values are read using "@OSGIService" inside a @Model class. Hence I am unable to connect these dots, so kindly enlight me to understand whats happening in the background.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi,
The @OSGIService annotation is specific for sling models, you cannot use it outside a sling model, in other words, it is expected to get null if you are using this annotation within an OSGI service. Check the official doc: https://sling.apache.org/apidocs/sling8/org/apache/sling/models/annotations/injectorspecific/OSGiSer...
Hope this helps
@PrasanthAnandharaj Have you checked the following-
Make sure the bundle is active;
Make sure the component is active;
Check for unresolvable dependencies in the bundle;
Check for unsatisfied references in the component;
Hi,
The @OSGIService annotation is specific for sling models, you cannot use it outside a sling model, in other words, it is expected to get null if you are using this annotation within an OSGI service. Check the official doc: https://sling.apache.org/apidocs/sling8/org/apache/sling/models/annotations/injectorspecific/OSGiSer...
Hope this helps
Views
Likes
Replies
Views
Likes
Replies