Reputation: 59
I deployed a package in OSGi bundle of AEM 6.0 which has a status of Active. But when I tried to use it run-time in a certain page, it shows some exception:
05.06.2015 18:12:29.460 *ERROR* [0:0:0:0:0:0:0:1 [1433499148835] GET /content/g0/en/about-us/career/jobs.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
java.lang.NoClassDefFoundError: javax/xml/namespace/QName
...
....
...
Caused by: java.lang.ClassNotFoundException: javax.xml.namespace.QName not found by com.**.wcm.recruitment-client [499]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1557)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 240 common frames omitted
I tried to manipulate the Import-Package and Export-Package under pom.xml but still concern persists.
See below for the XML that I am trying to manipulate.
<plugin>
...
...
<instructions>
<Bundle-Activator>com.**.recruitment.Activator</Bundle-Activator>
**<Import-Package>
!javax.xml.namespace,*
</Import-Package>
<Export-Package>
com.**.recruitment.client,
com.**.recruitment.ws
</Export-Package>
<Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
...
...
</plugin>
Upvotes: 0
Views: 610
Reputation: 1231
Instruction: <Import-Package>!javax.xml.namespace, *</Import-Package>
avoids package javax.xml.namespace
being imported which is the opposite you need. Just remove !
Make sure javax.xml.namespace package is exported in your OSGi environment: It should be by default in any case you can try by setting this environment variable:
org.osgi.framework.system.packages.extra=javax.xml.namespace;<other packages>
Upvotes: 1