You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Michael Harrison <go...@alumni.princeton.edu> on 2002/05/11 15:27:51 UTC

trouble using org.apache.xerces.parsers.DOMParser

I know this is not an interesting question, but I could use the help.

I'm in the process of teaching myself how to work with XML in Java, and I've hit a perplexing problem. I'm working on an example servlet that simply creates a parser to parse an XML tree form a file and then make modifications to it and reserialize it back into a file. It's actually an example from Brett McLaughlin's "Java & XML" book, UpdateItemServlet, just in case you're familiar with it.

When I call the servlet from Tomcat (4.0.3 on Windows), I get 
java.lang.NoClassDefFoundError: org/apache/xerces/parsers/AbstractDOMParser

The servlet, which imports org.apache.xerces.parsers.DOMParser, compiles (as it does when I also import ...parsers.AbstractParser and ...parsers.*), so I obviously have the org.apache.xerces.parsers package's JAR in my classpath, at least as far as the compiler is concerned. Does this sound like a classpath problem, or am I completely missing something?I've read a lot of side notes about DOM 1 versus DOM 2 support, but I don't think that's the issue. 

I have Xerces 2.0.1 and JDK 1.3.1, in case that helps.

This is a side note, but is there a mapping of packages to jar files available for Xerces and Tomcat (and all the other Apache java projects)? It's confusing to be told to make sure a package is available when you don't know exactly which JAR you need to put in your classpath, along with the other nine hundred paths you've added already.

Many thanks, and I promise I'll have more interesting things to contribute soon.

Michael