You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Milt Epstein <me...@uiuc.edu> on 2001/04/02 05:44:02 UTC
RE: 2nd Post: Servlets and mod_jk problem
On Fri, 30 Mar 2001, Kyle Tippetts wrote:
> Milt,
>
> I made the changes that Jeff did and I can now get to the /test
> servlets, but whenever I add my own context and try it (I even
> simulated one of the examples in the /test directory, I still get a
> 404 not found from tomcat. Here's what I have in my simulation
> (note that the context does in fact get added when tomcat
> starts....)
We may be going around in circles here, but:
What was the URL you tried? mydomain.com/tst/foo/bar/myServlet? And
what is the full text of the tomcat log 404 error message?
Also, I note you have "Web-inf" in the full path of your
servlet/classes directory below -- is that really what it is, or are
you just being lazy typing "WEB-INF" (because I believe it's supposed
to be ALL CAPS)?
Not sure what else to suggest at this point. Must be some little
thing we're missing.
> * mod_jk.conf
> Alias /tst "/opt/jakarta-tomcat-3.2.1/webapps/tst"
> JkMount /tst/* ajp13
> JkMount /tst/servlet/* ajp13
>
> * web.xml
> <webapp>
> <servlet>
> <servlet-name>
> test
> </servlet-name>
> <servlet-class>
> com.tst.TestServlet
> </servlet-class>
> </servlet>
>
> <servlet-mapping>
> <servlet-name>
> test
> </servlet-name>
> <url-pattern>
> /foo/bar/*
> </url-pattern>
> </servlet-mapping>
> </webapp>
>
> * TestServlet.class sits at
> /opt/jakarta-tomcat-3.2.1/webapps/tst/Web-inf/classes/com/tst
>
> Thanks
> --Kyle
>
> -----Original Message-----
> From: Milt Epstein [mailto:mepstein@uiuc.edu]
> Sent: Friday, March 30, 2001 3:48 PM
> To: 'tomcat-user@jakarta.apache.org'
> Subject: RE: 2nd Post: Servlets and mod_jk problem
>
>
> On Fri, 30 Mar 2001, Kyle Tippetts wrote:
>
> > Yes, tried this:
> > mydomain.com/test/foo/bar/myServlet
> > and it still didn't work. Now, if I do
> > mydomain.com/test/servlet/requestMap.Servlet1, I can access it
> > (obviously), but again, it really appears that servlet mappings
> > aren't working....
>
> Now again, when this doesn't work, is it an apache thing or a tomcat
> thing? What I'm trying to get at is, is apache forwarding the request
> to tomcat. That will help isolate where the problem is at. In
> particular, if it's an apache thing, it means the request isn't even
> getting to tomcat, so it probably has to do with the relevant Mount
> (ApJServMount, ApJkMount) directives in the tomcat/apache conf file
> (or, more accurately, the lack of such). This is a problem I ran into
> when I was setting up some stuff.
>
> Did you see Jeff Kilbride's recent post? Apparently he was able to
> get it to work by adding an appropriate ApJkMount directive.
>
> This does seem to be one of the less clear/less well-documented
> aspects of setting tomcat up.
>
>
> > -----Original Message-----
> > From: Milt Epstein [mailto:mepstein@uiuc.edu]
> > Sent: Friday, March 30, 2001 2:43 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: 2nd Post: Servlets and mod_jk problem
> >
> >
> > On Fri, 30 Mar 2001, Jeff Kilbride wrote:
> >
> > [ ... ]
> > > 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
> >
> > Did you try the URL:
> >
> > mydomain.com/test/foo/bar/myServlet
> >
> > i.e. without the "/servlet"? My impression is that the url-pattern's
> > in servlet-mapping's are meant to follow the context part of the URL,
> > and that you don't need to include "/servlet" (although you do need to
> > include it if you are just using the servlet-name or the fully
> > qualified servlet-class). That is, part of the point of using
> > servlet-mapping's is so you don't need to have the "/servlet" in the
> > URL. This might explain some of your apparent anomalies when using
> > "test" (you had it both as the servlet-name and the url-pattern in a
> > servlet-mapping, IIRC).
> >
> >
> > > 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.
> > [ ... ]
>
> Milt Epstein
> Research Programmer
> Software/Systems Development Group
> Computing and Communications Services Office (CCSO)
> University of Illinois at Urbana-Champaign (UIUC)
> mepstein@uiuc.edu
>
Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
mepstein@uiuc.edu