Ok, I have an application (named 'abc' application) deployed in
Tomcat 5.5 on Solaris using the war deploy feature in the manager.
The application (lets call it 'foo') shows up in the manager as '/foo', so I know that it deploys. When I look in catalina.log, I see a ClassNotFound exception, alerting me that the ClassLoader wasn't able to find my ControllerServlet class. Here is the error from Catalina.log:
2006-07-24 09:38:46,987 DEBUG org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/foo] - Sending application start events
2006-07-24 09:38:46,987 DEBUG org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/foo] - Starting filters
2006-07-24 09:38:47,002 INFO org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/foo] - Marking
servlet controller as unavailable
2006-07-24 09:38:47,002 ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/foo] - Error loading WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@1c92535
com.abc.framework.controller.ControlServlet
java.lang.ClassNotFoundException: com.abc.framework.controller.ControlServlet
My ControlServlet class is located in this jar file webapps/foo/WEB-INF/lib/abc.jar in the package com.abc.framework.controller;.
I wanted to confirm that jar files in the WEB-INF/lib directory were included in the classpath for my application. In reading through the online documentation for Tomcat I found the following:
"WebappX - A class loader is created for each web application that is deployed in a single Tomcat 5 instance. All unpacked classes and resources in the /WEB-INF/classes directory of your web application archive, plus classes and resources in JAR files under the /WEB-INF/lib directory of your web application archive, are made visible to the containing web application, but to no others."
I am doing exactly this. My jar file (foo.jar) is in the webapps/abc/WEB-INF/lib directory for my 'abc' application. However, in the Catalina log file, when Tomcat starts, I get the above "ClassNotFound - com.abc.framework.ControlServlet" error. Why can my servlet not be found if it resides in abc.jar under the WEB-INF/lib directory???
Thanks,
Darren
[ July 24, 2006: Message edited by: Darren Hall ]