Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

RE: Classloading issue: common/lib/servlet-api.jar

Guy Rouillier

2004-01-27


Shapira, Yoav wrote:
> Howdy,
>
>> ClassNotFoundException - class you explicitly asked for is not found
>> NoClassDefFoundError - a class required by your class (through a new,
>> e.g.) was available at compile time but cannot be found now.
>
> I know what the errors mean, thanks ;) The most common cause
> for the latter is version skew: a class was found with the
> same name but not the same interfaces as the class you had at
> compile-time. For example, a version of
> javax.servlet.http.HttpServletRequest from a servlet
> specification 2.3 jar was found on a tomcat 5 classpath.

The jars that this page uses were definitely compiled with an earlier
version of servlet.jar than Tomcat 5 contains. That would produce
NoClassDefFoundError? Why would the error go away if I explicitly
include the subject jar in the classpath? Sorry, I have read all the
JBoss classloading docs, but have not yet read the Tomcat classloader
ref you supplied - I will.

>
>> I have no servlet jars other than the ones Tomcat 5.0.18 supplies.
>> I do have jboss-j2ee.jar in my classpath, and the code will not
>> compile without it: "javax\ejb\CreateException.class not found". I
>> moved the
>
> Are you running tomcat standalone or JBoss with embedded
> tomcat?

Standalone, though JBoss is running on the same box in a different JVM.

> Does the jboss-j2ee.jar have the servlet classes in it?

No.

Yoav, thanks for your time. I don't want to ask for any more of it
until I can get the chance to recompile the jars with the same servlet
jars Tomcat 5 is using (and I've read the classloader docs.)

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@(protected)
For additional commands, e-mail: tomcat-user-help@(protected)



©2008 junlu.com - Jax Systems, LLC, U.S.A.