D
drakaan
Well, I managed to get stuck just before I actually see any results
from a foray into using xpath with java.
I have some code (fairly straightforward):
56: String expression = "/systems/system";
57: InputSource inputSource = new InputSource("/folder/" + fileName);
58: XPath xpath = XPathFactory.newInstance().newXPath();
59: NodeList nodes = (NodeList) xpath.evaluate(expression,
inputSource, XPathConstants.NODESET);
That throws the following errors when run within the Eclipse IDE,
regardless of which folder/filename or expression I throw at it:
Exception in thread "main" java.lang.NoClassDefFoundError:
gnu.xml.pipeline.DomConsumer
at gnu.xml.pipeline.DomConsumer$Handler.<init>(libgcj.so.7rh)
at gnu.xml.pipeline.DomConsumer.<init>(libgcj.so.7rh)
at gnu.xml.dom.Consumer.<init>(libgcj.so.7rh)
at gnu.xml.dom.JAXPFactory$JAXPBuilder.<init>(libgcj.so.7rh)
at gnu.xml.dom.JAXPFactory.newDocumentBuilder(libgcj.so.7rh)
at gnu.xml.xpath.Expr.evaluate(libgcj.so.7rh)
at gnu.xml.xpath.XPathImpl.evaluate(libgcj.so.7rh)
at updateParser.SysmonParser.parseXml(Parser.java:59)
I have the following imports:
import java.util.Date;
import javax.xml.xpath.*;
import org.xml.sax.*;
import java.io.File;
import java.io.IOException;
import org.w3c.dom.*;
import org.jrobin.core.*;
My xml looks like:
<?xml version="1.0"?>
<systems>
<system id="12345678" address="xx.xx.xx.xx" osclass="windows"
uptime="1D 2H 51M">
</system>
</systems>
I'm very new to java, but not to xml data manipulation. The java
examples that I found seemed pretty straightforward (although they
often failed to mention what imports are required). My first thought
is still that I'm missing a library reference or something (I'm on
Fedora Core 6, Eclipse 3.2.0, and my workspace default is the
java-1.4.2-gcj-1.4.2.0 JRE).
Any insight as to how I might narrow down the cause of that
classDefNotFound error? It's driving me absolutely nuts.
Help. Please.
from a foray into using xpath with java.
I have some code (fairly straightforward):
56: String expression = "/systems/system";
57: InputSource inputSource = new InputSource("/folder/" + fileName);
58: XPath xpath = XPathFactory.newInstance().newXPath();
59: NodeList nodes = (NodeList) xpath.evaluate(expression,
inputSource, XPathConstants.NODESET);
That throws the following errors when run within the Eclipse IDE,
regardless of which folder/filename or expression I throw at it:
Exception in thread "main" java.lang.NoClassDefFoundError:
gnu.xml.pipeline.DomConsumer
at gnu.xml.pipeline.DomConsumer$Handler.<init>(libgcj.so.7rh)
at gnu.xml.pipeline.DomConsumer.<init>(libgcj.so.7rh)
at gnu.xml.dom.Consumer.<init>(libgcj.so.7rh)
at gnu.xml.dom.JAXPFactory$JAXPBuilder.<init>(libgcj.so.7rh)
at gnu.xml.dom.JAXPFactory.newDocumentBuilder(libgcj.so.7rh)
at gnu.xml.xpath.Expr.evaluate(libgcj.so.7rh)
at gnu.xml.xpath.XPathImpl.evaluate(libgcj.so.7rh)
at updateParser.SysmonParser.parseXml(Parser.java:59)
I have the following imports:
import java.util.Date;
import javax.xml.xpath.*;
import org.xml.sax.*;
import java.io.File;
import java.io.IOException;
import org.w3c.dom.*;
import org.jrobin.core.*;
My xml looks like:
<?xml version="1.0"?>
<systems>
<system id="12345678" address="xx.xx.xx.xx" osclass="windows"
uptime="1D 2H 51M">
</system>
</systems>
I'm very new to java, but not to xml data manipulation. The java
examples that I found seemed pretty straightforward (although they
often failed to mention what imports are required). My first thought
is still that I'm missing a library reference or something (I'm on
Fedora Core 6, Eclipse 3.2.0, and my workspace default is the
java-1.4.2-gcj-1.4.2.0 JRE).
Any insight as to how I might narrow down the cause of that
classDefNotFound error? It's driving me absolutely nuts.
Help. Please.