Hello.
I've seen topics similar to this one posted in this group, but I wasn't able to find a solution that worked for me, so I'l post my situation and hope someone here can help me.
I'm running
Tomcat 5.0 and Apache 2 on Windows XP Pro. I'm using mod_jk to create the Apache-Tomcat connection.
I'm dealing with existing HTML and
java servlets, and in our existing environment, all servlets were invoked using Tomcats invoker servlet. Moving forward, this will not be possible, however, in the short term, I want to get the existing site working using its current configuration but without using the invoker servlet. To start off, I've decided to try and get one servlet working properly, before I map all of the rest of them.
I successfully connected Tomcat and Apache together using mod_jk, and then mapped the example servlets as a
test. After that success, I created a new directory under webapps called 'servlet', and added the following entry to my httpd.conf -
# Send servlet for context /servlet to 'flcworker'
<Location /servlet/*>
JkMount flcworker
</Location>
I then created a webapps/servlet/WEB-INF/web.xml file that looks like this -
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<servlet>
<servlet-name>FLCUpEvDisplayServlet</servlet-name>
<servlet-class>FLCUpEvDisplayServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FLCUpEvDisplayServlet</servlet-name>
<url-pattern>/FLCUpEvDisplayServlet</url-pattern>
</servlet-mapping>
</web-app>
Upon restarting Tomcat and Apache, I tried to point to the URL
http://<localhost>/servlet/FLCUpEvDisplayServlet and received the following error -
exception
javax.servlet.ServletException: Wrapper cannot find servlet class FLCUpEvDisplayServlet or a class it depends on
root cause
java.lang.ClassNotFoundException: FLCUpEvDisplayServlet
In my log files I see the following (I'm not going to print the entire stack trace here, only what I think is relevant) -
2006-01-22 20:32:50 StandardContext[/servlet]Marking servlet FLCUpEvDisplayServlet as unavailable
2006-01-22 20:32:50 StandardContext[/servlet]Error loading WebappClassLoader
delegate: false
repositories:
/WEB-INF/classes/
2006-01-22 20:32:50 StandardWrapperValve[FLCUpEvDisplayServlet]: Allocate exception for servlet FLCUpEvDisplayServlet
javax.servlet.ServletException: Wrapper cannot find servlet class FLCUpEvDisplayServlet or a class it depends on
So, is this a simple classpath error? It looks like the classloader was unable to find my servlet, but since the class lives in the webapps/servlet/WEB-INF/classes directory, I thought it was included in the classpath of the app server by default, correct?
Can anyone explain what the cause of my problem is here?
Thanks.
[ January 22, 2006: Message edited by: Darren Hall ]