javax.inject dependency error
Hi Team,
We are facing the following error while installing the bundle in AEM 6.1
30.03.2018 09:06:20.286 *ERROR* [FelixDispatchQueue] com.training.project.core FrameworkEvent ERROR (org.osgi.framework.BundleException: Unresolved constraint in bundle com.training.project.core [512]: Unable to resolve 512.0: missing requirement [512.0] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=0.0.0)))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.training.project.core [512]: Unable to resolve 512.0: missing requirement [512.0] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=0.0.0))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4095)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2114)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1368)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.lang.Thread.run(Thread.java:748)
30.03.2018 09:10:43.674 *ERROR* [FelixDispatchQueue] com.training.project.core FrameworkEvent ERROR (org.osgi.framework.BundleException: Unresolved constraint in bundle com.training.project.core [512]: Unable to resolve 512.0: missing requirement [512.0] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=0.0.0)))
org.osgi.framework.BundleException: Unresolved constraint in bundle com.training.project.core [512]: Unable to resolve 512.0: missing requirement [512.0] osgi.wiring.package; (&(osgi.wiring.package=javax.inject)(version>=0.0.0))
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4095)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2114)
at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1368)
at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
at java.lang.Thread.run(Thread.java:748)
We have handled this dependency by adding the following package in the project.core pom.xml:-
<Import-Package>javax.inject;version=0.0.0,*</Import-Package>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.2.0</version>
<!-- for AEM6.1 use this version : <version>6.1.0</version> -->
<!-- for AEM6.1 SP1 use this version : <version>6.1.0-SP1-B0001</version> -->
<!-- for AEM6.1 SP2 use this version : <version>6.1.0-SP2</version> -->
<!-- for AEM6.2 use this version : <version>6.2.0</version> -->
<classifier>obfuscated-apis</classifier>
<scope>provided</scope>
</dependency>
Following changes has been added to the project pom.xml
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.2.0</version>
<!-- for AEM6.1 use this version : <version>6.1.0</version> -->
<!-- for AEM6.1 SP1 use this version : <version>6.1.0-SP1-B0001</version> -->
<!-- for AEM6.1 SP2 use this version : <version>6.1.0-SP2</version> -->
<!-- for AEM6.2 use this version : <version>6.2.0</version> -->
<classifier>obfuscated-apis</classifier>
<scope>provided</scope>
</dependency>
We have installed the bundle on UAT Author (AEM 6.1), the bundle works perfectly fine but the same does not work on Prod Author (AEM 6.1).
Please let me know any resolution on the same.
with regards,
Richa Chaubey