RE: 2nd Post: Servlets and mod_jk problem -- thanks!
At 09:53 PM 4/3/2001, you wrote: One thing to note, Tomcat for NT is not picky about this, because on my NT deployment of Tomcat, I have the WEB-INF directory named "web-inf" and everything works fine. [ ... ] You must come from a Windows background :-) -- under UNIX, everything has always been case-sensitive. And on Windows, it generally isn't. Although I thought I saw some Tomcat-related documentation that indicated that Tomcat is, or is going to be, case-sensitive on all platforms. Maybe that's for 4.0. Didn't it change between 3.1 and 3.2? I seem to recall having fun with that one, especially on the URLs. Jim -- * Jim Cheesman * Trabajo: [EMAIL PROTECTED] - (34)(91) 724 9200 x 2360 Personal: [EMAIL PROTECTED] (34) 606 770 244 Practice safe eating -- always use condiments.
RE: 2nd Post: Servlets and mod_jk problem -- thanks!
On Wed, 4 Apr 2001, Jim Cheesman wrote: At 09:53 PM 4/3/2001, you wrote: One thing to note, Tomcat for NT is not picky about this, because on my NT deployment of Tomcat, I have the WEB-INF directory named "web-inf" and everything works fine. [ ... ] You must come from a Windows background :-) -- under UNIX, everything has always been case-sensitive. And on Windows, it generally isn't. Although I thought I saw some Tomcat-related documentation that indicated that Tomcat is, or is going to be, case-sensitive on all platforms. Maybe that's for 4.0. Didn't it change between 3.1 and 3.2? I seem to recall having fun with that one, especially on the URLs. Maybe so, I don't remember exactly, I just remember seeing it somewhere. Milt Epstein Research Programmer Software/Systems Development Group Computing and Communications Services Office (CCSO) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED]
RE: 2nd Post: Servlets and mod_jk problem -- thanks!
Just want to thank everyone for their help and discussion on this problem. And, I wanted to let everyone know what I found out. Milt, it was your question about my Web-inf directory and whether it was all uppercase or not that cracked it. I originally created that directory as "Web-inf" but apparently on Linux, Tomcat expects this directory to be "WEB-INF." Once I renamed this directory and changed the Location tag in mod_jk.conf appropriately, I was able to get the servlet mappings for the context I added to work. One thing to note, Tomcat for NT is not picky about this, because on my NT deployment of Tomcat, I have the WEB-INF directory named "web-inf" and everything works fine. In summary, here are the two things that I had to fix to get my context's servlet mappings working on Linux: * add "JkMount /[deployment directory]/* ajp13" to the mod_jk.conf file. (This originally solved the problem of the /test servlets not working, and I had to add it to my context as well.) * ensure that WEB-INF is all uppercase. Thanks again, --Kyle -Original Message- From: Milt Epstein [mailto:[EMAIL PROTECTED]] Sent: Sunday, April 01, 2001 9:44 PM To: '[EMAIL PROTECTED]' Subject: 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:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 3:48 PM To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 2:43 PM To: [EMAIL PROTECTED] 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:
Re: 2nd Post: Servlets and mod_jk problem
-Original Message- From: Milt Epstein [EMAIL PROTECTED] To: '[EMAIL PROTECTED]' [EMAIL PROTECTED] Date: Monday, April 02, 2001 9:06 AM Subject: 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:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 3:48 PM To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 2:43 PM To: [EMAIL PROTECTED] 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 explanatio
Re: 2nd Post: Servlets and mod_jk problem
same problem i'm having. i've posted several messages regarding this in the last couple days. no solution yet though. what version of linux are you running? what version of apache? what version of mod_jk? (built yourself or from the jakarta web site?) have you tried mod_jserv also? (i did but it's segv'ing) -- 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 \ 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. Here's my situation: * classpath for my context is /opt/jakarta-tomcat-3.2.1/webapps/apo/Web-inf/classes * Servlet sits at /opt/jakarta-tomcat-3.2.1/webapps/apo/Web-inf/classes/com/center7/em/apps/ap o/src * pertinent parts of web.xml looks like this: servlet servlet-name CaapControlServlet /servlet-name servlet-class com.center7.em.apps.apo.src.CaapControlServlet /servlet-class /servlet servlet-mapping servlet-name CaapControlServlet /servlet-name url-pattern /CaapControlServlet /url-pattern /servlet-mapping * I'm using mod_jk, so I include a customized mod_jk.conf file in apache's httpd.conf. Inside the mod_jk.conf file, my context information is set up as follows: Alias /apo "/opt/jakarta-tomcat-3.2.1/webapps/apo" JkMount /apo/servlet/* ajp13 JkMount /apo/*.jsp ajp13 * 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. Now the interesting thing is that none of the example mapping servlets found in the /test directory work, either. So, have I set something up wrong, and if so, what have I overlooked or done wrong, or does servlet mapping not work with Tomcat 3.2.1? Thanks in advance. == --Kyle Tippetts --Center7 PilotCenter Development [EMAIL PROTECTED] --www.center7.com
Re: 2nd Post: Servlets and mod_jk problem
Are you adding extra path info when you call a servlet such that your urls look something like: http://www.center7.com/CaapControlServlet/some-data If you are, change the url-pattern in web.xml to: CaapControlServlet/* -- Rob --On Friday, March 30, 2001 10:11:06 AM -0700 Kyle Tippetts [EMAIL PROTECTED] 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. Here's my situation: * classpath for my context is /opt/jakarta-tomcat-3.2.1/webapps/apo/Web-inf/classes * Servlet sits at /opt/jakarta-tomcat-3.2.1/webapps/apo/Web-inf/classes/com/center7/em/ apps/ap o/src * pertinent parts of web.xml looks like this: servlet servlet-name CaapControlServlet /servlet-name servlet-class com.center7.em.apps.apo.src.CaapControlServlet /servlet-class /servlet servlet-mapping servlet-name CaapControlServlet /servlet-name url-pattern /CaapControlServlet /url-pattern /servlet-mapping * I'm using mod_jk, so I include a customized mod_jk.conf file in apache's httpd.conf. Inside the mod_jk.conf file, my context information is set up as follows: Alias /apo "/opt/jakarta-tomcat-3.2.1/webapps/apo" JkMount /apo/servlet/* ajp13 JkMount /apo/*.jsp ajp13 * 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. Now the interesting thing is that none of the example mapping servlets found in the /test directory work, either. So, have I set something up wrong, and if so, what have I overlooked or done wrong, or does servlet mapping not work with Tomcat 3.2.1? Thanks in advance. == --Kyle Tippetts --Center7 PilotCenter Development [EMAIL PROTECTED] --www.center7.com _ _ _ _ __ _ _ _ _ /\_\_\_\_\/\_\ /\_\_\_\_\_\ /\/_/_/_/_/ /\/_/ \/_/_/_/_/_/ QUIDQUID LATINE DICTUM SIT, /\/_/__\/_/ __/\/_//\/_/ PROFUNDUM VIDITUR /\/_/_/_/_/ /\_\ /\/_//\/_/ /\/_/ \/_/ /\/_/_/\/_//\/_/ (Whatever is said in Latin \/_/ \/_/ \/_/_/_/_/ \/_/ appears profound) Rob Tanner McMinnville, Oregon [EMAIL PROTECTED]
RE: 2nd Post: Servlets and mod_jk problem
Actually, depending on what's needed, there might be something like this: servlet/CaapControlServlet?control=display So do I need to enter that in the servlet mappings? Also, I can't get the /test servlets to work (you know, the ones that come with the Tomcat distribution. They are supposed to show how servlet mapping works, but I can't get them to work Thanks --Kyle -Original Message- From: Rob Tanner [mailto:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 10:49 AM To: [EMAIL PROTECTED] Subject: Re: 2nd Post: Servlets and mod_jk problem Are you adding extra path info when you call a servlet such that your urls look something like: http://www.center7.com/CaapControlServlet/some-data If you are, change the url-pattern in web.xml to: CaapControlServlet/* -- Rob --On Friday, March 30, 2001 10:11:06 AM -0700 Kyle Tippetts [EMAIL PROTECTED] 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. Here's my situation: * classpath for my context is /opt/jakarta-tomcat-3.2.1/webapps/apo/Web-inf/classes * Servlet sits at /opt/jakarta-tomcat-3.2.1/webapps/apo/Web-inf/classes/com/center7/em/ apps/ap o/src * pertinent parts of web.xml looks like this: servlet servlet-name CaapControlServlet /servlet-name servlet-class com.center7.em.apps.apo.src.CaapControlServlet /servlet-class /servlet servlet-mapping servlet-name CaapControlServlet /servlet-name url-pattern /CaapControlServlet /url-pattern /servlet-mapping * I'm using mod_jk, so I include a customized mod_jk.conf file in apache's httpd.conf. Inside the mod_jk.conf file, my context information is set up as follows: Alias /apo "/opt/jakarta-tomcat-3.2.1/webapps/apo" JkMount /apo/servlet/* ajp13 JkMount /apo/*.jsp ajp13 * 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. Now the interesting thing is that none of the example mapping servlets found in the /test directory work, either. So, have I set something up wrong, and if so, what have I overlooked or done wrong, or does servlet mapping not work with Tomcat 3.2.1? Thanks in advance. == --Kyle Tippetts --Center7 PilotCenter Development [EMAIL PROTECTED] --www.center7.com _ _ _ _ __ _ _ _ _ /\_\_\_\_\/\_\ /\_\_\_\_\_\ /\/_/_/_/_/ /\/_/ \/_/_/_/_/_/ QUIDQUID LATINE DICTUM SIT, /\/_/__\/_/ __/\/_//\/_/ PROFUNDUM VIDITUR /\/_/_/_/_/ /\_\ /\/_//\/_/ /\/_/ \/_/ /\/_/_/\/_//\/_/ (Whatever is said in Latin \/_/ \/_/ \/_/_/_/_/ \/_/ appears profound) Rob Tanner McMinnville, Oregon [EMAIL PROTECTED]
Re: 2nd Post: Servlets and mod_jk problem
Hi Kyle, A query string like that shouldn't make a difference. You only need to change your url-pattern if you're adding extra path info to contain the data you're passing to your servlet. Servlet mapping definitely works with 3.2.1/mod_jk on Linux, because that's what I'm using. I suggest you set your log levels to DEBUG and check out your tomcat.log and servlet.log files. Your tomcat.log should have something like this: ContextManager: Adding context Ctx( yourContext ) And, if you choose to have your servlet load on startup, your servlet.log should have: path="" :yourServlet: init even before you hit your servlet with a request. Thanks, --jeff - Original Message - From: "Kyle Tippetts" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 30, 2001 10:02 AM Subject: RE: 2nd Post: Servlets and mod_jk problem Actually, depending on what's needed, there might be something like this: servlet/CaapControlServlet?control=display So do I need to enter that in the servlet mappings? Also, I can't get the /test servlets to work (you know, the ones that come with the Tomcat distribution. They are supposed to show how servlet mapping works, but I can't get them to work Thanks --Kyle -Original Message- From: Rob Tanner [mailto:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 10:49 AM To: [EMAIL PROTECTED] Subject: Re: 2nd Post: Servlets and mod_jk problem Are you adding extra path info when you call a servlet such that your urls look something like: http://www.center7.com/CaapControlServlet/some-data If you are, change the url-pattern in web.xml to: CaapControlServlet/* -- Rob --On Friday, March 30, 2001 10:11:06 AM -0700 Kyle Tippetts [EMAIL PROTECTED] 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. Here's my situation: * classpath for my context is /opt/jakarta-tomcat-3.2.1/webapps/apo/Web-inf/classes * Servlet sits at /opt/jakarta-tomcat-3.2.1/webapps/apo/Web-inf/classes/com/center7/em/ apps/ap o/src * pertinent parts of web.xml looks like this: servlet servlet-name CaapControlServlet /servlet-name servlet-class com.center7.em.apps.apo.src.CaapControlServlet /servlet-class /servlet servlet-mapping servlet-name CaapControlServlet /servlet-name url-pattern /CaapControlServlet /url-pattern /servlet-mapping * I'm using mod_jk, so I include a customized mod_jk.conf file in apache's httpd.conf. Inside the mod_jk.conf file, my context information is set up as follows: Alias /apo "/opt/jakarta-tomcat-3.2.1/webapps/apo" JkMount /apo/servlet/* ajp13 JkMount /apo/*.jsp ajp13 * 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. Now the interesting thing is that none of the example mapping servlets found in the /test directory work, either. So, have I set something up wrong, and if so, what have I overlooked or done wrong, or does servlet mapping not work with Tomcat 3.2.1? Thanks in advance. == --Kyle Tippetts --Center7 PilotCenter Development [EMAIL PROTECTED] --www.center7.com _ _ _ _ __ _ _ _ _ /\_\_\_\_\/\_\ /\_\_\_\_\_\ /\/_/_/_/_/ /\/_/ \/_/_/_/_/_/ QUIDQUID LATINE DICTUM SIT, /\/_/__\/_/ __/\/_//\/_/ PROFUNDUM VIDITUR /\/_/_/_/_/ /\_\ /\/_//\/_/ /\/_/ \/_/ /\/_/_/\/_//\/_/ (Whatever is said in Latin \/_/ \/_/ \/_/_/_/_/ \/_/ appears profound) Rob Tanner McMinnville, Oregon [EMAIL PROTECTED]
RE: 2nd Post: Servlets and mod_jk problem
Milt, The 404 error comes from tomcat. Also, the jsp that's used to invoke the servlet sits at /webapps/apo 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]
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 \
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 JSP or HTML page? You said the latter previously. How exactly are you invoking (i.e. what's the code look like, whether it's in the JSP or HTML)? Also, the exact text of the error message in the log might suggest something. (I don't necessarily have an idea of what the problem is, just trying to throw out ideas that might turn into leads.) -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]
RE: 2nd Post: Servlets and mod_jk problem
The servlet is invoked from a jsp like this: % //processing logic response.sendRedirect("servlet/CaapControlServlet?control=login"); % (Sidenote: the reason I don't use jsp:forward page="servlet/CaapControlServlet"/ is because depending on certain criteria, I need to redirect the user to different places) Also, tomcat's error.log file reports: File does not exist: /opt/jakarta-tomcat-3.2.1/webapps/apo/servlet/CaapControlServlet Thanks --Kyle -Original Message- From: Milt Epstein [mailto:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 11:55 AM To: '[EMAIL PROTECTED]' 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 JSP or HTML page? You said the latter previously. How exactly are you invoking (i.e. what's the code look like, whether it's in the JSP or HTML)? Also, the exact text of the error message in the log might suggest something. (I don't necessarily have an idea of what the problem is, just trying to throw out ideas that might turn into leads.) -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]
RE: 2nd Post: Servlets and mod_jk problem
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-nametest/servlet-name description A simple servlet to test our configuration. /description servlet-classcom.westsidei.servlet.TestServlet/servlet-class !-- Load this servlet at server startup time -- load-on-startup4/load-on-startup /servlet servlet-mapping servlet-nametest/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 \
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) [EMAIL PROTECTED]
RE: 2nd Post: Servlets and mod_jk problem
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 --Kyle -Original Message- From: Milt Epstein [mailto:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 2:43 PM To: [EMAIL PROTECTED] 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) [EMAIL PROTECTED]
Re: 2nd Post: Servlets and mod_jk problem
AHA!!! Actually, using my old config, pulling up mydomain.com/test/foo/bar/myServlet returned an Apache 404 error. I had tried that initially and gave up when Apache returned the error. But your post turned the little lightbulb on in my head!:o) It makes sense that /test/foo/bar/myServlet wasn't pulling up, because in my original config I hadn't specified a connector for /test/* -- only for /test/*.jsp and /test/servlet/*, like the examples in mod_jk.conf-auto. So, I went back and changed my original config to this: JkMount /test/* JkMount /test/servlet/* And POOF!! Now everything works. The only thing that sucks is that you have to serve the whole directory via Tomcat in order to use servlet-mappings -- HTML and all. Maybe there should be a way to *turn off* extensions as well as turn them *on*, so you could specify to Tomcat not to serve *.html. (!*.html ??) I wonder if it's documented anywhere that in order to use servlet-mappings, you need to do this as opposed to following the examples and mod_jk.conf-auto. (should be...) My /test servlet didn't interfere, because it's actually set up in a different context under a virtual host -- using the Host directive in server.xml. One down!! Thanks, Milt. This was bugging me. --jeff - Original Message - From: "Milt Epstein" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 30, 2001 1:42 PM 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) [EMAIL PROTECTED]
Re: 2nd Post: Servlets and mod_jk problem
ok, it sounds like we're getting somewhere... Jeff, could you now try the examples servlets that come with tomcat-3.2.1 and translate your solution to those and the default mod_jk.conf-auto? Todd On Fri, 30 Mar 2001, Jeff Kilbride wrote: AHA!!! Actually, using my old config, pulling up mydomain.com/test/foo/bar/myServlet returned an Apache 404 error. I had tried that initially and gave up when Apache returned the error. But your post turned the little lightbulb on in my head!:o) It makes sense that /test/foo/bar/myServlet wasn't pulling up, because in my original config I hadn't specified a connector for /test/* -- only for /test/*.jsp and /test/servlet/*, like the examples in mod_jk.conf-auto. So, I went back and changed my original config to this: JkMount /test/* JkMount /test/servlet/* And POOF!! Now everything works. The only thing that sucks is that you have to serve the whole directory via Tomcat in order to use servlet-mappings -- HTML and all. Maybe there should be a way to *turn off* extensions as well as turn them *on*, so you could specify to Tomcat not to serve *.html. (!*.html ??) I wonder if it's documented anywhere that in order to use servlet-mappings, you need to do this as opposed to following the examples and mod_jk.conf-auto. (should be...) My /test servlet didn't interfere, because it's actually set up in a different context under a virtual host -- using the Host directive in server.xml. One down!! Thanks, Milt. This was bugging me. --jeff - Original Message - From: "Milt Epstein" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 30, 2001 1:42 PM 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) [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 \
Re: 2nd Post: Servlets and mod_jk problem
Yes, it works under the default directory with the examples in the "test" context -- but, no, it won't work with mod_jk.conf-auto, because the auto generated config has this as it's defaults for JkMount: JkMount /test/servlet/* ajp12 JkMount /test/*.jsp ajp12 This MUST be changed to: JkMount /test/servlet/* ajp12 JkMount /test/* ajp12 in order for servlet-mapping to work. The re-mapped servlets are then called from /test/ not from /test/servlet/. Obviously, you can use either connector. I'm using ajp13 in my non-auto-generated mod_jk.conf. Thanks, --jeff - Original Message - From: "Todd Pfaff" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc: "Jeff Kilbride" [EMAIL PROTECTED] Sent: Friday, March 30, 2001 2:29 PM Subject: Re: 2nd Post: Servlets and mod_jk problem ok, it sounds like we're getting somewhere... Jeff, could you now try the examples servlets that come with tomcat-3.2.1 and translate your solution to those and the default mod_jk.conf-auto? Todd On Fri, 30 Mar 2001, Jeff Kilbride wrote: AHA!!! Actually, using my old config, pulling up mydomain.com/test/foo/bar/myServlet returned an Apache 404 error. I had tried that initially and gave up when Apache returned the error. But your post turned the little lightbulb on in my head!:o) It makes sense that /test/foo/bar/myServlet wasn't pulling up, because in my original config I hadn't specified a connector for /test/* -- only for /test/*.jsp and /test/servlet/*, like the examples in mod_jk.conf-auto. So, I went back and changed my original config to this: JkMount /test/* JkMount /test/servlet/* And POOF!! Now everything works. The only thing that sucks is that you have to serve the whole directory via Tomcat in order to use servlet-mappings -- HTML and all. Maybe there should be a way to *turn off* extensions as well as turn them *on*, so you could specify to Tomcat not to serve *.html. (!*.html ??) I wonder if it's documented anywhere that in order to use servlet-mappings, you need to do this as opposed to following the examples and mod_jk.conf-auto. (should be...) My /test servlet didn't interfere, because it's actually set up in a different context under a virtual host -- using the Host directive in server.xml. One down!! Thanks, Milt. This was bugging me. --jeff - Original Message - From: "Milt Epstein" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 30, 2001 1:42 PM 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) [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 \
Re: 2nd Post: Servlets and mod_jk problem
On Fri, 30 Mar 2001, Jeff Kilbride wrote: AHA!!! Actually, using my old config, pulling up mydomain.com/test/foo/bar/myServlet returned an Apache 404 error. I had tried that initially and gave up when Apache returned the error. But your post turned the little lightbulb on in my head! :o) It makes sense that /test/foo/bar/myServlet wasn't pulling up, because in my original config I hadn't specified a connector for /test/* -- only for /test/*.jsp and /test/servlet/*, like the examples in mod_jk.conf-auto. So, I went back and changed my original config to this: JkMount /test/* JkMount /test/servlet/* And POOF!! Now everything works. The only thing that sucks is that Great! Glad to hear it. I had a feeling it might be related to missing Mount directives, because I ran into a similar problem/solution. you have to serve the whole directory via Tomcat in order to use servlet-mappings -- HTML and all. Maybe there should be a way to *turn off* extensions as well as turn them *on*, so you could specify to Tomcat not to serve *.html. (!*.html ??) I wonder if it's documented anywhere that in order to use servlet-mappings, you need to do this as opposed to following the examples and mod_jk.conf-auto. (should be...) [ ... ] I agree that these aspects of the configuration aren't as well integrated (and documented) as they should be. It looks like if you're not careful, you can accidentally open up things that weren't intended to be available. (For example, you need to put in sections related to the META-INF and WEB-INF directories so they don't get served.) And there may be some negative, unintended consequences of Mount'ing a URL pattern like "/test/*" (as you conjecture), I'm not quite sure. - Original Message - From: "Milt Epstein" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, March 30, 2001 1:42 PM 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). [ ... ] Milt Epstein Research Programmer Software/Systems Development Group Computing and Communications Services Office (CCSO) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED]
RE: 2nd Post: Servlets and mod_jk problem
imho, since apache is generating the error message, and tomcat is not generating any error message (in my logs anyway), the problem is with the apache configuration as it relates to tomcat. apache does not seem to be recognizing that tomcat should be handling the request and therefore does not pass it on. it just tried to resolve the url itself, fails and reports the 404 error. this is just my interpretation, i don't know if it's correct. On Fri, 30 Mar 2001, Milt Epstein wrote: 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:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 2:43 PM To: [EMAIL PROTECTED] 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) [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 \
RE: 2nd Post: Servlets and mod_jk problem
On Fri, 30 Mar 2001, Todd Pfaff wrote: imho, since apache is generating the error message, and tomcat is not generating any error message (in my logs anyway), the problem is with the apache configuration as it relates to tomcat. apache does not seem to be recognizing that tomcat should be handling the request and therefore does not pass it on. it just tried to resolve the url itself, fails and reports the 404 error. this is just my interpretation, i don't know if it's correct. I agree. And I believe this means it's a matter of adding the appropriate Mount directives to the tomcat/apache conf file. On Fri, 30 Mar 2001, Milt Epstein wrote: 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:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 2:43 PM To: [EMAIL PROTECTED] 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) [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 \ Milt Epstein Research Programmer Software/Systems Development Group Computing and Communications Services Office (CCSO) University of Illinois at Urbana-Champaign (UIUC) [EMAIL PROTECTED]
RE: 2nd Post: Servlets and mod_jk problem
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) * 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:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 3:48 PM To: '[EMAIL PROTECTED]' 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:[EMAIL PROTECTED]] Sent: Friday, March 30, 2001 2:43 PM To: [EMAIL PROTECTED] 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) [EMAIL PROTECTED]