tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Unckel" <boris.unckel....@gmx.net>
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" <chrisp@rochester.rr.com>
> 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?
Yes.

> 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.
http://wiki.apache.org/jakarta-commons/Commons_Logging_FUD

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.

Regards
Boris


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message