Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

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

Thread view: 
martin.wignall@gmail.com - 21 Dec 2005 17:06 GMT
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!


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.