M
Matt Rose
Dear all,
I am trying to use the jaxp 1.4 standalone download from java.net with
Sun JRE 1.4.2. Here is a minimal test class:
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
public class TestJaxp {
public static void main(String[] args) throws Exception {
Document doc = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
XPath xpath = XPathFactory.newInstance().newXPath();
xpath.evaluate("/", doc);
}
}
It fails with:
java.lang.NoClassDefFoundError: com/sun/org/apache/xalan/internal/
extensions/ExpressionContext
at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:
201)
at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:
275)
at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:
365)
at TestJaxp.main(TestJaxp.java:13)
Exception in thread "main"
My classpath consists of this class followed by jaxp-api.jar then jaxp-
ri.jar.
What am I doing wrong?
Thanks,
Matt
I am trying to use the jaxp 1.4 standalone download from java.net with
Sun JRE 1.4.2. Here is a minimal test class:
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.xpath.XPath;
import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Document;
public class TestJaxp {
public static void main(String[] args) throws Exception {
Document doc = DocumentBuilderFactory.newInstance()
.newDocumentBuilder().newDocument();
XPath xpath = XPathFactory.newInstance().newXPath();
xpath.evaluate("/", doc);
}
}
It fails with:
java.lang.NoClassDefFoundError: com/sun/org/apache/xalan/internal/
extensions/ExpressionContext
at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(XPathImpl.java:
201)
at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:
275)
at
com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(XPathImpl.java:
365)
at TestJaxp.main(TestJaxp.java:13)
Exception in thread "main"
My classpath consists of this class followed by jaxp-api.jar then jaxp-
ri.jar.
What am I doing wrong?
Thanks,
Matt