RE: Stubborn simple servlet
Hi, Read in some web doc that the plan is to write a tool tool for _generating_ all these config files rather than having to tweak them by hand. A good config tool would certainly have helped avoid a lot of head bashing. If anyone on this list knows of someone who is contemplating writing a tomcat config tool, please let me know. I know some requirements methodology approaches that can be applied when scoping such tools to help make them more user friendly and more maintainable. Be happy to teach You mean like http://www.icewalkers.com/Linux/Software/517150/webxml.html? ;) Or perhaps something to go on top of XDoclet, http://xdoclet.sourceforge.net/ant/xdoclet/modules/web/WebXmlSubTask.htm l http://xdoclet.sourceforge.net/tags/web-tags.html ? ;) Yoav Shapira This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stubborn simple servlet
From: [EMAIL PROTECTED] Rick Lutowski With further fussing, this works! I had changed web.xml to key on /pix_servlet/*.pxhtml as an experiment. When I changed it back to the original *.pxhtml and used the Context base 'ship_pix' in the URL (either absolute or relative), everything started clicking. Check SRV.11.2 of the Servlet 2.3 specification, /pix_servlet/*.pxhtml is not a valid wildcard mapping. The choices are: - starts with / and ends with /* - starts with *. - contains the single character / Anything else requires an exact match on the requested URL. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stubborn simple servlet
http://jakarta.apache.org/tomcat/faq/misc.html#invoker -Original Message- From: rick [mailto:rick] On Behalf Of Rick Lutowski Sent: Tuesday, March 16, 2004 3:13 PM To: [EMAIL PROTECTED] Subject: Stubborn simple servlet - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stubborn simple servlet
From: [EMAIL PROTECTED] An trying to convert a simple servlet of the HelloWorld variety (pure HTML -- no JSP, EJB, JDBC, etc) from tomcat 3.2.3 to 4.1.30. It works fine with tomcat 3.2.3 in standalone mode but gives a 404 error in 4.1.30 with both netscape and mozilla. What URL are you visiting when you get the 404 error? Any chance it has /servlet/ in it? If so, read here: http://test.javaranch.com/wiki/view?InvokerServlet -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stubborn simple servlet
Wendy Smoak wrote: From: [EMAIL PROTECTED] An trying to convert a simple servlet of the HelloWorld variety (pure HTML -- no JSP, EJB, JDBC, etc) from tomcat 3.2.3 to 4.1.30. It works fine with tomcat 3.2.3 in standalone mode but gives a 404 error in 4.1.30 with both netscape and mozilla. What URL are you visiting when you get the 404 error? Any chance it has /servlet/ in it? If so, read here: http://test.javaranch.com/wiki/view?InvokerServlet Probably not the problem. The following Context's were added to the end of the distro server.xml: !-- JReality contexts !-- equiv to apache htdocs -- this one works and gives 4.1.30 access to the vanilla html pages -- Context path=/jreality docBase=jreality debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=jreality_log. suffix=.txt timestamp=true/ /Context !-- for support of an applet, not a servlet -- does not work, but one problem at a time! -- Context path=/surveyor docBase=surveyor debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=surveyor_log. suffix=.txt timestamp=true/ /Context !-- the Stubborn Simple Servlet -- Context path=/ship_pix docBase=ship_pix debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=ship_pix_log. suffix=.txt timestamp=true/ /Context The above pairs with the following in the servlet web.xml file: servlet servlet-nameLdjServlet/servlet-name description Generates dynamic pages for the LDJ web site. Currently this consists of frame list pages for displaying selected ship photos. The pages generated have the names pix_dir.html for the list of ship photo subdirectories (the upper left list of the photo frame) and pix_[subdir].html for the list of photos in one subdirectory (the lower left list of the photo frame). /description servlet-classcom.jreality.ldj.l_ships.LdjServlet/servlet-class /servlet servlet-mapping servlet-nameLdjServlet/servlet-name url-pattern*.pxhtml/url-pattern /servlet-mapping The above does not appear to match the 'invoker' patterns shown in the referenced URL's. The above works in tomcat 3.2.3. -- Rick Lutowski Principal, JReality [EMAIL PROTECTED] http://www.jreality.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stubborn simple servlet
What URL are you using to access a given page (one that gives you a 404)? something like: http://www.foo.com/ship_pix/index.pxhtml ? -Original Message- From: rick [mailto:rick] On Behalf Of Rick Lutowski Sent: Tuesday, March 16, 2004 4:07 PM To: Tomcat Users List Subject: Re: Stubborn simple servlet Wendy Smoak wrote: From: [EMAIL PROTECTED] An trying to convert a simple servlet of the HelloWorld variety (pure HTML -- no JSP, EJB, JDBC, etc) from tomcat 3.2.3 to 4.1.30. It works fine with tomcat 3.2.3 in standalone mode but gives a 404 error in 4.1.30 with both netscape and mozilla. What URL are you visiting when you get the 404 error? Any chance it has /servlet/ in it? If so, read here: http://test.javaranch.com/wiki/view?InvokerServlet Probably not the problem. The following Context's were added to the end of the distro server.xml: !-- JReality contexts !-- equiv to apache htdocs -- this one works and gives 4.1.30 access to the vanilla html pages -- Context path=/jreality docBase=jreality debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=jreality_log. suffix=.txt timestamp=true/ /Context !-- for support of an applet, not a servlet -- does not work, but one problem at a time! -- Context path=/surveyor docBase=surveyor debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=surveyor_log. suffix=.txt timestamp=true/ /Context !-- the Stubborn Simple Servlet -- Context path=/ship_pix docBase=ship_pix debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=ship_pix_log. suffix=.txt timestamp=true/ /Context The above pairs with the following in the servlet web.xml file: servlet servlet-nameLdjServlet/servlet-name description Generates dynamic pages for the LDJ web site. Currently this consists of frame list pages for displaying selected ship photos. The pages generated have the names pix_dir.html for the list of ship photo subdirectories (the upper left list of the photo frame) and pix_[subdir].html for the list of photos in one subdirectory (the lower left list of the photo frame). /description servlet-classcom.jreality.ldj.l_ships.LdjServlet/servlet-class /servlet servlet-mapping servlet-nameLdjServlet/servlet-name url-pattern*.pxhtml/url-pattern /servlet-mapping The above does not appear to match the 'invoker' patterns shown in the referenced URL's. The above works in tomcat 3.2.3. -- Rick Lutowski Principal, JReality [EMAIL PROTECTED] http://www.jreality.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stubborn simple servlet
Rick Lutowski wrote: Probably not the problem. Okay, but you still haven't told us what URL gives the 404. That you're getting a 404 means that Tomcat cannot map the URL you're providing to anything it has to offer. Context path=/ship_pix docBase=ship_pix debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=ship_pix_log. suffix=.txt timestamp=true/ /Context Where is the 'ship_pix' directory and what does it contain? Are you sure that the context is starting? Any errors in catalina.out, or in the context log files on startup, or right after you get the 404? My money is on a config problem. Personally I do not mess with server.xml other than to change the hostname and port number. So if I had to debug this problem locally, I would put server.xml back the way it was, put the contexts directly under 'webapps' and watch the logs closely. -- Wendy Smoak Application Systems Analyst, Sr. ASU IA Information Resources Management - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stubborn simple servlet
Mike Curwen wrote: What URL are you using to access a given page (one that gives you a 404)? something like: http://www.foo.com/ship_pix/index.pxhtml ? That is the next step. Currently just trying to get standalone working, so the URL is more like: http://localhost:8080/jreality/ldj/l.ships/servlet/pix.pxhtml?base=CV10 This is the resolved path that appears in the browser. The link in the html file is a href=servlet/pix.pxhtml?base=CV10 The parent html file is in jreality/ldj/l.ships which is correctly resolved by 4.1.30 via the /jreality Context. On the off chance that /servlet may be a problem in 4.1.30, also tried changing the path to pix_servlet, i.e., http://localhost:8080/jreality/ldj/l.ships/pix_servlet/pix.pxhtml?base=CV10 in the web.xml and the parent html files. Same 404 error: HTTP status 404 - the resource /jreality/ldj/l.ships/pix_servlet/pix.pxhtml?base=CV10 is not available -- Rick Lutowski Principal, JReality [EMAIL PROTECTED] http://www.jreality.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Stubborn simple servlet
Is the servlet configured under the jreality webapp or the ship_pix one? If it's the jreality, try linking: a href=pix.pxhtml?base=CV10 if it's the other, try: a href=http://localhost:8080/ship_pix/pix.pxhtml?base=CV10; your link has /servlet in it, so yes, the invoker servlet being off by default in 4.1.30 is likely(?) coming into play. Frames always confuse the issue for me, so maybe I'm not entirely understanding your page layouts and how/when servlets are being called. Also , when did 'pix_servlet' come into it? what is that? -Original Message- From: rick [mailto:rick] On Behalf Of Rick Lutowski Sent: Tuesday, March 16, 2004 6:25 PM To: Tomcat Users List Subject: Re: Stubborn simple servlet Mike Curwen wrote: What URL are you using to access a given page (one that gives you a 404)? something like: http://www.foo.com/ship_pix/index.pxhtml ? That is the next step. Currently just trying to get standalone working, so the URL is more like: http://localhost:8080/jreality/ldj/l.ships/servlet/pix.pxhtml?base=CV10 This is the resolved path that appears in the browser. The link in the html file is a href=servlet/pix.pxhtml?base=CV10 The parent html file is in jreality/ldj/l.ships which is correctly resolved by 4.1.30 via the /jreality Context. On the off chance that /servlet may be a problem in 4.1.30, also tried changing the path to pix_servlet, i.e., http://localhost:8080/jreality/ldj/l.ships/pix_servlet/pix.pxhtml?base=C V10 in the web.xml and the parent html files. Same 404 error: HTTP status 404 - the resource /jreality/ldj/l.ships/pix_servlet/pix.pxhtml?base=CV10 is not available -- Rick Lutowski Principal, JReality [EMAIL PROTECTED] http://www.jreality.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stubborn simple servlet
Wendy Smoak wrote: Rick Lutowski wrote: Probably not the problem. Okay, but you still haven't told us what URL gives the 404. That you're getting a 404 means that Tomcat cannot map the URL you're providing to anything it has to offer. Context path=/ship_pix docBase=ship_pix debug=0 reloadable=true crossContext=true Logger className=org.apache.catalina.logger.FileLogger prefix=ship_pix_log. suffix=.txt timestamp=true/ /Context Where is the 'ship_pix' directory and what does it contain? ship_pix is a soft link in webapps to the actual directory. In case the link might be causing the problem, also tried an absolute path in the Context, e.g.: Context path=/ship_pix docBase=/path_to_base_dir as well as a relative path. e.g., Context path=/ship_pix docBase=../../..//path_to_base_dir No difference. 404. The /jreality Context also uses a link in webapps and works fine in both 3.2.3 and 4.1.30. So 4.1.30 accepts a link here. aside I did discover that 3.2.3 accepted a link to jar files in WEB-INF/lib but 4.1.30 did not. So I moved all the jars physically into WEB-INF/lib. After that all startup errors in the 4.1.30 log files went away and the jars are now deploying properly (based on the logs). /aside Are you sure that the context is starting? Any errors in catalina.out, or in the context log files on startup, or right after you get the 404? No errors in any log files. All log messages are INFO and appear to reflect normal operation. No, am not sure the context is starting. 3.2.3 printed context activation messages to the screen on startup but 4.1.30 does not. Rather 4.1.30 prints log messages about contexts being ignored (or somesuch) if there are errors. Assume this means that 'no news is good news' in the logs. The logs are no longer printing bad news about contexts. That's all I know for sure. My money is on a config problem. Personally I do not mess with server.xml other than to change the hostname and port number. So if I had to debug this problem locally, I would put server.xml back the way it was, put the contexts directly under 'webapps' and watch the logs closely. Am sure you are right; am also assuming it is a config problem. Have also tried deleting the Context's from server xml and letting it deploy with defaults based on what is in webapps. According to the logs the jars deploy the same as before. Same problem -- 404 -- so went back to explicit Context in server.xml since I know that worked in 3.2.3. Also allows some refinements like separate log files, which _is_ working so the Context's are at least partly correct. I usually get these things to go by beating them 'every which way but loose but this time nothing has been able to 'make my day.' Appreciate the help. -- Rick Lutowski Principal, JReality [EMAIL PROTECTED] http://www.jreality.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stubborn simple servlet
Mike Curwen wrote: Is the servlet configured under the jreality webapp or the ship_pix one? The /ship_pix context. No servlets are under /jreality If it's the jreality, try linking: a href=pix.pxhtml?base=CV10 if it's the other, try: a href=http://localhost:8080/ship_pix/pix.pxhtml?base=CV10; Good thought, but no joy: 404 -- /ship_pix/pix.pxhtml is not available With a href=http://localhost:8080/ship_pix/pix_servlet/pix.pxhtml?base=CV10; the error is 404 -- /ship_pix/pix_servlet/pix.pxhtml is not available your link has /servlet in it, so yes, the invoker servlet being off by default in 4.1.30 is likely(?) coming into play. Frames always confuse the issue for me, so maybe I'm not entirely understanding your page layouts and how/when servlets are being called. Rechecked server.xml and you are right, invoker is not included. This might be the problem. Will look into enabling it (unless there is another way to launch simple servlets.) Also , when did 'pix_servlet' come into it? what is that? pix_servlet is just a rename of the servlet subdirectory in case 4.1.30 blacklists servlet for being a 'dirty word'. However, the rename made no difference. -- Rick Lutowski Principal, JReality [EMAIL PROTECTED] http://www.jreality.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Stubborn simple servlet
Rick Lutowski wrote: Mike Curwen wrote: if it's the other, try: a href=http://localhost:8080/ship_pix/pix.pxhtml?base=CV10; With a href=http://localhost:8080/ship_pix/pix_servlet/pix.pxhtml?base=CV10; the error is 404 -- /ship_pix/pix_servlet/pix.pxhtml is not available With further fussing, this works! I had changed web.xml to key on /pix_servlet/*.pxhtml as an experiment. When I changed it back to the original *.pxhtml and used the Context base 'ship_pix' in the URL (either absolute or relative), everything started clicking. Thanks for the help! :-)) BTW -- Read in some web doc that the plan is to write a tool tool for _generating_ all these config files rather than having to tweak them by hand. A good config tool would certainly have helped avoid a lot of head bashing. If anyone on this list knows of someone who is contemplating writing a tomcat config tool, please let me know. I know some requirements methodology approaches that can be applied when scoping such tools to help make them more user friendly and more maintainable. Be happy to teach these techniques to the folks involved. Thanks again. -- Rick Lutowski Principal, JReality [EMAIL PROTECTED] http://www.jreality.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]