Hi,
I've recently moved a web application running under Tomcat4.0.6, and
java 4.0.2 to JBoss4.0.3 and java 5.0. The application works fine under
Tomcat with java 4.0.2. However, I'm getting the exception
"java.lang.ClassNotFoundException:
org/apache/crimson/parser/XMLReaderImpl" being thrown from JBoss with
java 5.0. The line of code in my application causing all the trouble
is:
XMLReader parser =
XMLReaderFactory.createXMLReader("org.apache.crimson.parser.XMLReaderImpl");
Now, this works fine in Tomcat with java 4.0.2, as java 4.0.2 includes
the class org.apache.crimson.parser.XMLReaderImpl. See:
http://java.sun.com/j2se/1.5.0/compatibility.html for the comment:
"JAXP - The J2SE 1.4 platform included JAXP 1.1 ("Crimson"). The J2SE
5.0 platform includes JAXP 1.3 ("Xerces"). Crimson and Xerces are not
simply different versions of the same codebase. Instead, they are
entirely different implementations of the JAXP standard. So, while they
both conform to the JAXP standard, there are some subtle differences
between them."
However, java 5.0 does not include this class, and hence the problem.
My question is therefore, what class do I need to use in place of
org.apache.crimson.parser.XMLReaderImpl in order to make my application
work with java 5.0?
Many thnaks,
Martin.
Larry - 21 Dec 2005 19:57 GMT
You can download and add Apache's Crimson XML Parser to your project,
then you'll have that class available: http://xml.apache.org/crimson/
Manfred Rosenboom - 22 Dec 2005 07:54 GMT
> Hi,
> I've recently moved a web application running under Tomcat4.0.6, and
[quoted text clipped - 26 lines]
> Many thnaks,
> Martin.
Simply change your code to
XMLReader parser = XMLReaderFactory.createXMLReader();
J2SE 1.4 will use the Crimson classes with this coding
and J2SE 5 will use the Xerces classes.
Best,
Manfred
martin.wignall@gmail.com - 22 Dec 2005 09:21 GMT
Many thanks Manfred - that sounds ideal!