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:
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???
Darren [ July 24, 2006: Message edited by: Darren Hall ]
posted 12 years ago
And, I found the cause of the problem.
Essentially, my build.xml file was not including my compiled classes in the jar file, so the jar was essentially empty and the resulting war file I was deploying contained an empty jar.
Thus the class loader was unable to find my servlet.
I've repaired my build.xml and fixed the issue.
Paper beats rock. Scissors beats tiny ad.
how do I do my own kindle-like thing - without amazon