Some strange problem with Tomcat 5.5 + JDK1.5

F

fduch_nsk

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

rawat81

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
 
F

fduch_nsk

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?
 

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

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top