[jdom-interest] yet another NoClassDefFoundError

Tobias Thierer lists-2006 at tobias-thierer.de
Tue May 30 17:45:11 PDT 2006


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ElementScannerTest.java
Type: java/*
Size: 1859 bytes
Desc: not available
Url : http://www.jdom.org/pipermail/jdom-interest/attachments/20060531/966fb09f/ElementScannerTest.bin


More information about the jdom-interest mailing list