XPathFactory error with Glassfish
I'm trying to use XPath in a bundle and I'm getting the following exception:
java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFactory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom at javax.xml.xpath.XPathFactory.newInstance(XPathFactory.java:101)
The thing is that this is a fresh install of Glassfish 3.1.1 (Build 12) running on Java 1.6. If I make a simple java app:
public static void main(String[] args) {
XPath p=XPathFactory.newInstance().newXPath();
System.out.println(p);
}
It works ok, so my java is not the problem, the problem is something in Glassfish. From what I have googled it seems this is usually a class conflict problem (using xerces/xalan jars in Java 1.5/1.6?). The problem is that I don't know where to start looking. Please help...
The attachment is the testbundle Im using, just an activator trying to get a XPathFactory instance.
| Attachment | Size |
|---|---|
| test_xpath-1.0.0.jar | 4.06 KB |





So nothing? Nobody ever try to use XPathFactory in a bundle in glassfish?
Ok, since XPathFactory.newInstance() does not work on Glassfish for the moment I'm calling it directly using:
XPath p=new com.sun.org.apache.xpath.internal.jaxp.XPathFactoryImpl().newXPath();
I dont like it but at least it works until glassfish get fixed.