yet another NoClassDefFoundError 2006-05-30 - By Tobias Thierer
Back Hi,
I have an XML document to parse in the form:
<a> <b>...</b> <b>...</b> <b>...</b> .. <b>...</b> </a>
The whole document is too large to hold in memory, so I wanted to get only one b-element at the time from the parser. I tried to use ElementScanner and ElementListener from jdom-contrib, but run into a NoClassDefFoundError when I call
elementScanner.addElementListener(elementListener, "/a/*");
I also get the error when I try the ElementScannerTest.java example file (attached) that comes with the jdom-contrib documentation. The error occurs in line 384 of XPathMatcher.java, where it tries to call
Class.forName("org.jdom.contrib.input.scanner.JakartaRegExpXPathMatcher")
this fails with a NoClassDefFoundError which is then caught and masked, so in the end I get the following error message:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/regexp/RESyntaxException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:164) at org.jdom.contrib.input.scanner.XPathMatcher.newXPathMatcher(XPathMatcher.java :384) at org.jdom.contrib.input.scanner.ElementScanner.addElementListener(ElementScanner .java:240) at ElementScannerTest.main(ElementScannerTest.java:23)
I've searched this mailinglist's archives and there were plenty repors of NoClassDefFoundErrors, but none of them in conjunction with RESyntaxException.
I have observed this problem on three different machines, but still wonder if it might be a configuration problem. Any ideas or hints would be greatly appreciated.
Thanks in advance,
Tobias
P.S.: An IntelliJ project including jdom.jar, jdom-contrib.jar and ElementScannerTest.java which exhibits the above error can be downloaded from: http://www.tobias-thierer.de/stuff/jdom-error.zip
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
|
|