Hello all,

I am new to tomcat and running into a problem that I am unable to resolve. I don't know all the correct vocabulary to use here, so bare with me as I attempt to describe the problem I'm running into. Here goes...

In a nutshell:
All requests to:

dwww.mycompany.com:8010/foor/bar.ext

get forwarded correctly to the servlet running in ${APP_BASE} until a directory named ${APP_BASE}/foo exists. Once a directory named $ {APP_BASE}/foo exists (and can be empty), no requests of the form above will get sent to the correct (in this case only) servlet. I simply get a 404 error as a response.


The details:
I believe this issue has to do with how tomcat maps a request to a servlet, but have no idea of what I'm doing wrong. My research online of sun's servlet spec and the tomcat website hasn't provided me a solution (or has and I haven't recognized it :-P). Here is my server.xml configuration:

<Server port="8005" shutdown="SHUTDOWN">
<Service name="Tomcat-Page">
                <Connector port="8010" enableLookups="false"/>

                <Engine name="Page" defaultHost="dwww.mycompany.com">

<Host name="dwww.mycompany.com" appBase="/opt/path/to/webapps/page" unpackWARs="false" autoDeploy="true">

                                <Context path=""
                                                 docBase="."
                                                 reloadable="true"
                                                 crossContext="true"
                                                 cookies="false" >
                                </Context>

                        </Host>

                </Engine>
        </Service>
</Server>

And the web.xml configuration in /opt/path/to/webapps/page/WEB-INF/:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
  PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
  "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";>

<web-app>
  <display-name>Page Application</display-name>

    <servlet>
        <servlet-name>mycompany</servlet-name>
        <servlet-class>
                mycompany.PageProcessor
        </servlet-class>
        <init-param>
            <param-name>debug</param-name>
            <param-value>0</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>mycompany</servlet-name>
        <url-pattern>*.ext</url-pattern>
    </servlet-mapping>
</web-app>

Conclusion:
My understanding from this configuration is that all requests on port 8010, that end with the extension .ext should be forwarded to the servlet "mycompany". From what I've read, any paths created in the $ {APP_BASE} directory should be irrelevant in this mapping and all logic comes from the web.xml file. My understanding appears to be wrong and I would greatly appreciate being pointed in the right direction.


Side Note:
This issue does not occur when hosted on windows for some reason, just when on linux and Mac OS X.

Thank you in advance!
Terence.

Reply via email to