I am currently working with CQ5/AEM, and we have an @Reference annotation that seems to act in a similar fashion to an injector annotation.
Our problem was that we had a misconfiguration in our POM file, which caused the injection to just fail.
We had to brute force change the POM file section by section to identify what was causing the problem. Brute force is obviously never the best approach.
What are the different methods in other frameworks such as spring, to debug annotative injectors when they fail?
Any advice would be greatly appreciated, as we are finding it a common enough problem.
<plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.3.7</version> <configuration> <instructions> <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency> <Embed-Directory>OSGI-INF/lib</Embed-Directory> <Embed-Transitive>true</Embed-Transitive> </instructions> </configuration> </plugin>
We fixed it after removing configuration.
However by setting the replicator dependency with scope of provided also solved it.
<dependency> <groupId>com.day.cq</groupId> <artifactId>cq-replication</artifactId> <version>5.4.24</version> <scope>provided</scope> </dependency>
My core question is still, given that we only have @Reference being null to start with, would you have any suggestions for how to attack this problem given just a null on a reference?