java.lang.ClassNotFoundException: org/apache/crimson/parser/XMLReaderImpl

M

martin.wignall

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.
 
M

Manfred Rosenboom

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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,227
Latest member
Daniella65

Latest Threads

Top