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

Reply via email to