Unable to resolve bundle
I am getting the following error when trying to install my bundle. Other than separating my bundle in to two individual bundles. Do you have any solution?
21.11.2014 15:10:47.158 *INFO* [OsgiInstallerImpl] org.apache.sling.installer.core.impl.tasks.BundleStartTask Could not start bundle com.mycompany.aem.core-bundle [397]. Reason: {}. Will retry. org.osgi.framework.BundleException: Uses constraint violation. Unable to resolve bundle revision com.mycompany.aem.core-bundle [397.15] because it is exposed to package 'javax.inject' from bundle revisions org.apache.sling.models.api [344.0] and org.apache.sling.scripting.java [215.0] via two dependency chains. Chain 1: com.mycompany.aem.core-bundle [397.15] import: (&(osgi.wiring.package=javax.inject)(version>=0.0.0)(!(version>=1.0.0))) | export: osgi.wiring.package=javax.inject org.apache.sling.models.api [344.0] Chain 2: com.mycompany.aem.core-bundle [397.15] import: (&(osgi.wiring.package=com.google.common.cache)(version>=15.0.0)(!(version>=16.0.0))) | export: osgi.wiring.package=com.google.common.cache; uses:=javax.inject com.google.guava [78.0] import: (osgi.wiring.package=javax.inject) | export: osgi.wiring.package=javax.inject org.apache.sling.scripting.java [215.0] at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3986) at org.apache.felix.framework.Felix.startBundle(Felix.java:2043) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963) at org.apache.sling.installer.core.impl.tasks.BundleStartTask.execute(BundleStartTask.java:93) at org.apache.sling.installer.core.impl.OsgiInstallerImpl.executeTasks(OsgiInstallerImpl.java:733) at org.apache.sling.installer.core.impl.OsgiInstallerImpl.run(OsgiInstallerImpl.java:247) at java.lang.Thread.run(Thread.java:744)I believe it is caused by these two dependencies as they both export Javax.inject:
<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>15.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.apache.sling</groupId> <artifactId>org.apache.sling.models.api</artifactId> <version>1.0.0</version> </dependency>
