felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Gravell <elstensoftw...@googlemail.com>
Subject "No XPathFactory implementation found for the object model" when using XPath
Date Wed, 11 Jul 2012 11:29:44 GMT
I'm a little puzzled about this. I have the following piece of code:

XPathFactory xpathFactory = XPathFactory.newInstance();

I have the following import in the manifest for the bundle containing the
above code:

Import-Package: javax.xml.xpath

When I run, I get:

java.lang.RuntimeException: XPathFactory#newInstance() failed to create an
XPathFactory for the default object model:
http://java.sun.com/jaxp/xpath/dom with the
javax.xml.xpath.XPathFactoryConfigurationException: No XPathFactory
implementation found for the object model:
at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:98)

It looks like XPath tries to load the class

Shouldn't this work? I only need to import the package for the API I use,
not the impl too right?

Do I need to add com.sun.org.apache.xpath.internal.jaxp to the
Export-Packages on my system bundle fragment? If so, why? I thought this
was only required if I was directly
accessing com.sun.org.apache.xpath.internal.jaxp (with a requisite
Import-Package) from my bundle.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message