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 / June 2005

Tip: Looking for answers? Try searching our database.

Some strange problem with Tomcat 5.5 + JDK1.5

Thread view: 
fduch_nsk - 14 Jun 2005 17:38 GMT
Hi All, my name is Alex.

I'am experiencing the following problem: in our web application we're
using xercesImpl.jar library to support XML serialization and it worked
fine for earlier versions of Tomcat server - simply because Tomcat 4.x
contains this library in /common/endorsed/ folder. But when I upgraded
to Tomcat 5.5 + JDK 1.5 I noticed that there is no xercesImpl.jar
folder in the appropriate folder any more. But when I run my
application under tomcat 5.5 and jdk 1.5, it crashes and I see the
following error:

java.lang.NoClassDefFoundError: org/apache/xml/serialize/XMLSerializer

However, it is described in the JDK1.5 documentation that it already
contains some XML parser implemented. Does anyone know what steps I
should perform to use this JDK1.5 parser instead of a parser which is
implemented in xercesImpl.jar .What changes and where should be done?

The web application is developed by Eclipse platform.

Any help will be appreciated!

Thanks.
rawat81@yahoo.com - 14 Jun 2005 20:04 GMT
Hi

Does you application refer to xerces Classes directly? JDK 1.5 has
xerces already with it (probably). Probably you are facing rare class
loading issues with application servers. (Please read documentation on
tomcat class loading for details).

Xerces classes are being loaded by the System classloader and are hence
unavailable to your webapp classloader. (I will have to read tomcat
docs for more elaborate explanation :-) )

Thanks
RSR
fduch_nsk - 14 Jun 2005 21:10 GMT
Hi, thank you for your reply!

You are exactly correct that the problem is that xerces classes are
loaded  by the system class loader. As the Tomcat 5.5 documentation
says:

"In previous versions of Tomcat 5, you could simply replace the XML
parser in the $CATALINA_HOME/common/lib directory to change the parser
used by all web applications. However, this technique will not be
effective when you are running on J2SE 1.4, because the usual class
loader delegation process will always choose the implementation inside
the JDK in preference to this one."

But it seems that I am able to avoid the error
java.lang.NoClassDefFoundError by simply copying necessary xerces
classes to Tomcat 5.5 installation directory.

Any ideas why it could happen?


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



©2008 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.