tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Claassen <...@donnell.com>
Subject RE: CGI ...yeah, I know (Tomcat 4.1.29)
Date Tue, 09 Nov 2004 15:42:10 GMT
2004-11-08 16:06:55 StandardContext[]: Servlet  threw load() exception
javax.servlet.ServletException: Wrapper cannot find servlet class
dsi.app.tomcat.DCGIServlet or a class it depends on
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:89
1)
        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3422)
...
----- Root Cause -----
java.lang.ClassNotFoundException: dsi.app.tomcat.DCGIServlet
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1443)
        at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1289)
        at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:88
5)
        at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:823)
        at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3422)
        at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3623)
        at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
        at
org.apache.catalina.core.StandardHost.start(StandardHost.java:754)

I thought I was being careful.  The only non-core library needed to compile
it needed was the catalina.jar, which is in that directory.  And it was the
exact same code.  I tried for hours to figure it out, and then I put it in
common and, bang, it worked.  The only change between the original tomcat
code and mine was the package.  And since it worked when I put it in common,
the web.xml information must have been correct.  The invoker servlet was off
the whole time.

> -----Original Message-----
> From: Shapira, Yoav [mailto:Yoav.Shapira@mpi.com] 
> Sent: Tuesday, November 09, 2004 8:52 AM
> To: Tomcat Users List
> Subject: RE: CGI ...yeah, I know (Tomcat 4.1.29)
> 
> 
> 
> Hi,
> 
> >I still have one question though,
> >
> >How come when I copied the source from 4.1.31 directly into my own
> class
> >(with no dependencies) I got ClassNotFound exceptions and it 
> would not
> run
> 
> Was it really a CNFE or a NoClassDefFoundError?  
> 
> You have to be very careful with dependencies once you start 
> putting stuff in shared, common, and server classloader 
> repositories.  That's why I recommend never doing that, and 
> just keeping everything in your WEB-INF/lib directory.
> 
> The reason you must be very careful is that class com.foo 
> loaded from shared/lib is not the same as com.foo loaded from 
> common/lib or WEB-INF/lib.  A class is unique within its 
> classloader, and these are distinct classloaders.  This leads 
> to problems with applications that package classes such that 
> some classes are in more than one repository, or that require 
> upwards (common/lib needing WEB-INF/lib for example) 
> repository lookups.  No-no.
> 
> Yoav
> 
> 
> 
> This e-mail, including any attachments, is a confidential 
> business communication, and may contain information that is 
> confidential, proprietary and/or privileged.  This e-mail is 
> intended only for the individual(s) to whom it is addressed, 
> and may not be saved, copied, printed, disclosed or used by 
> anyone else.  If you are not the(an) intended recipient, 
> please immediately delete this e-mail from your computer 
> system and notify the sender.  Thank you.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 



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


Mime
View raw message