tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Unckel" <>
Subject Re: Class loading from within a servlet: interface definition not found
Date Sat, 29 Apr 2006 08:45:51 GMT
Hello Christopher,

> Von: "Christopher Piggott" <>
> QUESTION: looking at the little diagram in the Tomcat 5.5 Class Loader
> HOW-TO, when I do the above (Class.forName) I am using the Webapp class
> loader, correct?

> The handler classes are all in handlers.jar which is in
> $CATALINA_BASE/shared/lib.  The actual exception that I get is:
> 	2006-04-28 17:05:55 StandardWrapperValve[xdb]: Servlet.service() 
> for
> servlet xdb threw exception
> 	java.lang.NoClassDefFoundError: 
> org/something/DatabaseRequestHandler
> Trouble is: the interface .class file is right there in
> WEB-INF/classes/com/something/DatabaseRequestHandler.class just like it 
> should be.  So, I am
> stumped why the class loader would be able to find the handler class in
> $CATALINA_BASE/shared/lib but NOT the interface that it implements which 
> is in
> WEB-INF/classes.
This looks very similiar to problems with Jakarta Commons Logging, caused by
wrong position of the different JCL jars.
It is generally not a good idea to share JARs. This should just be done if
they require it (i.E. some JDBC drivers).

For JCL there is a lot of material about the special issues with wrong
positions, i.E.

Try to put everything you need under WEB-INF/lib, even if it means to copy
the shared JARs into different webapps.
Please post the result.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message