Thanks for your help Warren. I think I've made some progress on this problem, but I've encountered another error. Here's where I am now...
I commented out all references to JK2 and downloaded mod_jk-apache-2.0.55.so. I've set up mod_jk in apache's httpd.conf, and I am now connecting to Tomcat successfully that way (example servlets have been mapped successfully). It looks like my original problem was caused by a simple mapping error. My httpd.conf file now has a <Location> tag that forwards all requests for '/servlet', as such # Send servlet for context /servlet to 'worker1' <Location /servlet/*> JkMount worker1 </Location> Under webapps, I've created a 'servlet' directory, and my webapps/servlet/WEB-INF/web.xml file looks like this (note, I removed the '/servlet' from the url-pattern, and this fixed my 'resource not found' issue) - <?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> So, I've made some progress (I think), but now I'm getting a new error - 2006-01-22 19:21:01 StandardWrapperValve[FLCUpEvDisplayServlet]: Allocate exception for servlet FLCUpEvDisplayServlet javax.servlet.ServletException: Wrapper cannot find servlet class FLCUpEvDisplayServlet or a class it depends on So.... did I hit my servlet, or did the classloader fail to locate it?? Thanks. -----Original Message----- From: Warren Pace [mailto:[EMAIL PROTECTED] Sent: Saturday, January 21, 2006 9:34 AM To: Tomcat Users List Subject: Re: (newb) Tomcat servlet mapping problem > > From: "Darren Hall" <[EMAIL PROTECTED]> > Date: 2006/01/20 Fri PM 02:28:22 EST > To: <users@tomcat.apache.org> > Subject: (newb) Tomcat servlet mapping problem > > I'm running Tomcat 5.0.30 and Apache 2.0 (both are running fine and without > errors). > > I've connected them using mod_jk2, and I can see that apache is correctly > forwarding URLs specified in the workers2.properties file correctly. > > > I am now attempting to map a test servlet called "SimpleServlet" to an URL. > > I've deployed the servlet in the directory "SimpleServlet". In the > webapps/SimpleServlet/WEB-INF directory I've added the following web.xml > file: > > > > <?xml version="1.0" encoding="ISO-8859-1"?> > > <web-app xmlns="http://java.sun.com/xml/ns/j2ee" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee > http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" > > version="2.4"> > > > > <servlet> > > <servlet-name>SimpleServlet</servlet-name> > > <servlet-class>us.souther.simple.SimpleServlet</servlet-class> > > </servlet> > > > <servlet-mapping> > > <servlet-name>SimpleServlet</servlet-name> > > <url-pattern>/simple-servlet</url-pattern> > > </servlet-mapping> > > > > </web-app> > > > > In the ${catalina.home}/conf/Catalina/localhost directory, I've added the > following SimpleServlet.xml file: > > > > <?xml version='1.0' encoding='utf-8'?> > > <!-- Make the servlet reloadable --> > > <Context path="/simple-servlet" docBase="SimpleServlet" reloadable="true" > debug="99"> > > <Logger className="org.apache.catalina.logger.FileLogger" > > directory="logs" prefix="simple." suffix=".log" > > timestamp="true"/> > > </Context> > > > > In the workers2.properties file (on the Apache side), I've added the > following entry: > > > > [uri:localhost/simple-servlet/*] > > worker=ajp13:localhost:8009 > > debug=99 > > > > When I try to hit the URL http://localhost/simple-servlet I get back this > response from Tomcat: > > > > HTTP Status 404 -/simple-servlet > > type Status report > > message /simple-servlet > > description The requested resource (/simple-servlet) is not available. > > Apache Tomcat / 5.0.30 > > > > Can anyone please tell me why my servlet is not mapped to the URL properly? > > > > Thanks. > > > > Darren > > Darren, I'm pretty new to this as well. Here are a couple of things I do know. mod_jk2 is deprecated. That doesn't mean it won't work but all development effort has been re-focusted to mod_jk. It's simple enough to download and build. 1) Is your servlet in a package (us.souther.simple)? Did it compile without error? 2) Generally the directory tree for servlets in packages = WEB-INF/classes/us/souther/simple (which is where your web.xml is telling tomcat to look for the class file). 3) Double-check the path entry in your context tag. I moved from tomcat 4 to tomcat 5.5, skipping the 5.0 releases so I can't provide any insight on the context directives (in 5.5 you don't specify a context path). Just make sure it's pointing tomcat to something real. 4) Some good resources are Jayson Falkner & Kevin Jones book "Servlets and JSP The J2EE Web Tier", this mailing list, and Google. Hope this helps. Warren > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]