I have written an OSGi bundle which has dependency on following spring framework bundle and some other similar JARs.
org.springframework.core-3.2.3.RELEASE.jar
Most of the times, the spring framework core bundle starts without any problem. But at times, the bundle fails to resolve dependency. Following error is thrown on click of start button in felix console:
*ERROR* [FelixDispatchQueue] org.springframework.core FrameworkEvent ERROR (org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.core [494]: Unable to resolve 494.0: missing requirement [494.0] osgi.wiring.package; (&(osgi.wiring.package=javax.xml.stream.events)(version>=0.0.0)))
org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.core [494]: Unable to resolve 494.0: missing requirement [494.0] osgi.wiring.package; (&(osgi.wiring.package=javax.xml.stream.events)(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(Unknown Source)
Also, some other spring framework JAR's too throw the same error and fail to resolve/start.
*ERROR* [FelixDispatchQueue] org.springframework.beans FrameworkEvent ERROR (org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.beans [495]: Unable to resolve 495.0: missing requirement [495.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.commons.logging)(version>=1.1.1)(!(version>=2.0.0))))
org.osgi.framework.BundleException: Unresolved constraint in bundle org.springframework.beans [495]: Unable to resolve 495.0: missing requirement [495.0] osgi.wiring.package; (&(osgi.wiring.package=org.apache.commons.logging)(version>=1.1.1)(!(version>=2.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(Unknown Source)
As per my understanding, javax.* packages are provided by system bundle. Can anyone please help me in solving this ?
EDIT:
This is happening when I kill the java process. Also this is happening for all bundles which have following imports :
javax.jcr
javax.swing
javax.xml.stream.events
org.apache.commons.logging
javax.servlet
javax.sql
javax.script
javax.net
When I kill the java process and I restart my AEM, I am facing this issue. When I uninstall the bundle and restart my AEM and reinstall the bundle, it works just fine.