Thanks JB. Importing javax.xml.parsers solved the problem. I was under
the impression that having JRE export in jre.properties should be
enough. By the way, what is the purpose of exports in the jre.properties?
Regards,
Raj
On Tuesday 17 June 2014 01:00 AM, Jean-Baptiste Onofré wrote:
Hi,
Try to import the javax.xml.parsers package in your bundle, or as
least enable the dynamic import. It should help.
Regards
JB
On 06/16/2014 08:21 PM, Rajbir Saini wrote:
Hi,
I am a bundle which uses XML DOM parsing. While installing this bundle
in Karaf 3.0.1, system throws java.lang.NoClassDefFoundError:
javax/xml/parsers/ParserConfigurationException. I am using Oracle JDK
1.7 and javax/xml/parsers is part of the JRE. I looked into the
jre.properties and javax.xml.parsers is included in Java platform
exports. I have looked into the endorsed folder and there is
org.apache.servicemix.specs.jaxp-api-1.4-2.4.0.jar which also exports
the javax.xml.parser package. I have tried removing this jar from
endorsed folder as suggested elsewhere. This causes another error
java.lang.ClassNotFoundException: org.xml.sax.SAXException. Relevent
part of the stack trace is given below. Does someone experienced similar
issue with Karaf 3.0.1 and are their any work around?
=====================Exception with removing jaxp specs jar
=================
Caused by: java.lang.NoClassDefFoundError:
javax/xml/parsers/ParserConfigurationException
at com.viithiisys.web.extender.Activator.start(Activator.java:23)
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
... 39 more
Caused by: java.lang.ClassNotFoundException:
javax.xml.parsers.ParserConfigurationException not found by
com.viithiisys.web.extender [78]
at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_51]
... 42 more
=====================Exception after removing jaxp specs
jar====================
java.lang.NoClassDefFoundError: org/xml/sax/SAXException
at com.viithiisys.web.extender.Activator.start(Activator.java:23)
at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
at
org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1291)
at
org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.ClassNotFoundException: org.xml.sax.SAXException
not found by com.viithiisys.web.extender [78]
at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 7 more
Regards,
Raj