Reflection Inside Tomcat engine

C

Claudio!

Hi!
I neet do use Digester inside a Servlet to parse an XML file.

Now, the problem is that Digester use the reflection to create on the
fly the objects associated to the various entity of the XML file.

The classes that Digester have to instantiate via reflection are
developped by me, and (for now) they stay under WEB-INF/classes.

The problem is that when the parsing start (inside the servlet),
Digester can't see that classes as the ClassNotFoundException arise.

Some days ago I've read that the problem is relative to the Tomcat's
classloader. At that time i put that class in a JAR under WEB-INF/lib
but this didn't work. So I moved it under WEB-INF/classes, but also
this seem to not work.

It works only if i put that class in a JAR under dir. "commons/lib" of
Tomcat.

It is normal? I want it under "WEB-INF/classes" if it is possible (the
deploy of application would be easier)

I'm using Java 1.4.2 and Tomcat 5.0.30.

Thank you for any help!!!

Claudio.
 
T

Tobias Schierge

It is normal? I want it under "WEB-INF/classes" if it is possible (the
deploy of application would be easier)

Try putting your own commons-digester and related jars also into
web-inf/lib, then it should work.

If you refer to tomcat internal classes classloading may be messed up.

Regards,

Tobias
 

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,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top