This is my thoughts exactly. If the examples in /test don't work, then it
would appear that there's something wrong with tomcat?

--Kyle

-----Original Message-----
From: Jeff Kilbride [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 1:43 PM
To: [EMAIL PROTECTED]
Subject: Re: 2nd Post: Servlets and mod_jk problem


Hi Todd,

I'm running RedHat 6.2, Sun jdk1.3, apache 1.3.12. For my own stuff, I'm
doing a lot of virtual hosting. So, my context mappings are a little
different than normal. However, upon further investigation, it seems that
the servlet mappings are not working for me, either! My entries looked like
this:

<servlet>
        <servlet-name>test</servlet-name>
        <description>
                A simple servlet to test our configuration.
        </description>
        <servlet-class>com.westsidei.servlet.TestServlet</servlet-class>

        <!-- Load this servlet at server startup time -->
        <load-on-startup>4</load-on-startup>
</servlet>

<servlet-mapping>
        <servlet-name>test</servlet-name>
        <url-pattern>/test</url-pattern>
</servlet-mapping>

As you can see, my servlet-mapping was just restating my servlet-name
parameter. When I pulled this up under /test, everything worked okay so I
assumed the servlet-mapping was working. Wrong!

When I changed the url-pattern to "/foo" or "foo" as opposed to /test, it
stopped working! Been running around for an hour trying to figure out why,
but it's beyond me. Everything is set up correctly, so there's no reason
this shouldn't work. As you stated earlier, none of the servlet-mappings in
the "test" context that came with the Tomcat distribution are pulling up
correctly, either. I even moved them out of the default location
($TOMCAT_HOME/webapps) and explicitly set a new context up in server.xml.
Still no joy.

Here's my server.xml with my explicit context:
<Context path="/test"
         docBase="/usr/local/java/webapps/dist/test"
         crossContext="false"
         debug="0"
          reloadable="true"
          trusted="false">
</Context>

Here's the servlet-mapping from web.xml file that comes with the
distribution:
<servlet>
    <servlet-name>
        servlet1
    </servlet-name>
    <servlet-class>
        requestMap.Servlet1
    </servlet-class>
</servlet>

<servlet-mapping>
    <servlet-name>
        servlet1
    </servlet-name>
    <url-pattern>
        /foo/bar/*
    </url-pattern>
</servlet-mapping>

Here's a snippet from my tomcat.log when I try to pull up
mydomain.com/test/servlet/foo/bar/myServlet:
985983892264 - Ctx( /test ): 404 R( /test + /servlet/foo + /bar/myServlet)
null

This mapping is supposed to map everything under /servlet/foo/bar/ to
servlet1 -- but as you can see, Tomcat is saying /servlet/foo, with extra
path info /bar/myServlet, doesn't exist. When I pull up
mydomain.com/test/servlet/requestMap.Servlet1 or
mydomain.com/test/servlet/servlet1, everything works as it should. So,
Tomcat is not paying attention to the servlet-mapping entry.

I think this is a problem, unless somebody has an explanation. I'm out of
ideas.

Thanks,
--jeff

----- Original Message -----
From: "Todd Pfaff" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Kyle Tippetts" <[EMAIL PROTECTED]>
Sent: Friday, March 30, 2001 10:53 AM
Subject: RE: 2nd Post: Servlets and mod_jk problem


> On Fri, 30 Mar 2001, Kyle Tippetts wrote:
>
> > Milt,
> >
> > The 404 error comes from tomcat. Also, the jsp that's used to invoke the
> > servlet sits at /webapps/apo
>
> really?  are you sure they're not coming from apache?
>
> > Thanks
> > --Kyle
> >
> > -----Original Message-----
> > From: Milt Epstein [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, March 30, 2001 10:35 AM
> > To: '[EMAIL PROTECTED]'
> > Subject: Re: 2nd Post: Servlets and mod_jk problem
> >
> >
> > On Fri, 30 Mar 2001, Kyle Tippetts wrote:
> >
> > > I'm having trouble getting servlet mapping to work properly using
mod_jk
> > on
> > > Tomcat 3.2.1 on Linux. First of all I should mention that jsps work
fine.
> > > Servlets work as well *if* they're located in the
> > > /webapps/whatever/Web-inf/classes directory, or if the url contains
the
> > > fully-qualified name of the servlet.
> > [ ... ]
> > > * The url I use inside an html page to access the servlet is
> > > servlet/CaapControlServlet
> > >   I then get a 404 error that says /apo/servlet/CaapControlServlet not
> > > found.
> > [ ... ]
> >
> > Is the error from apache or tomcat?  One way you can tell is by
> > checking which log file it shows up in, apache's or tomcat's.  Also,
> > where is the HTML page?
> >
> > Milt Epstein
> > Research Programmer
> > Software/Systems Development Group
> > Computing and Communications Services Office (CCSO)
> > University of Illinois at Urbana-Champaign (UIUC)
> > [EMAIL PROTECTED]
> >
>
> --
> Todd Pfaff                         \  Email: [EMAIL PROTECTED]
> Computing and Information Services  \ Voice: (905) 525-9140 x22920
> ABB 132                              \  FAX: (905) 528-3773
> McMaster University                   \
> Hamilton, Ontario, Canada  L8S 4M1     \
>
>

Reply via email to