I think, it only allows to compile for the packages which are part of the JRE. java.xml.parsers is part of the JRE and neither PDE nor Maven (Tycho) complains about it.

On Tuesday 17 June 2014 12:26 AM, Leschke, Scott wrote:
Sorry, sent unintentionally.

I've noticed that Eclipse PDE will sometimes allow things to compile even if 
you didn't import the package in the MANIFEST.MF.  Happened to me.

Scott

-----Original Message-----
From: Leschke, Scott
Sent: Monday, June 16, 2014 1:54 PM
To: 'user@karaf.apache.org'; 'raj.sa...@viithiisys.com'
Subject: RE: Error while deploying bundle using XML parser

Simple question.  Did you import package javax.xml.parsers

-----Original Message-----
From: Rajbir Saini [mailto:rajbsa...@yahoo.com]
Sent: Monday, June 16, 2014 1:21 PM
To: user@karaf.apache.org
Subject: Error while deploying bundle using XML parser

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


Reply via email to