RE: Cannot Run Servlets, only JSP's
Boy does this sound familiar! Check the posts with subject entitled RE: Directory Structure from yesterday. They may help. Sorry, if I knew to pass you the links I would. I had the SAME problem for 3 days! -Original Message- From: Johnson, Garrett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 10:59 AM To: 'Tomcat Users List' Subject: Cannot Run Servlets, only JSP's I'm running through the O'Reilly (onjava.com) tutorial on deploying applications in Tomcat, and I can't seem to get servlets to work. I render JSP's just fine, but once I request a servlet, I get a an HTTP Status 404 error: The requested resource (/onjava/servlet/com.onjava.login) is not available. Does anyone have any idea why this would happen? I can include any necessary log files if requested, but I've wandered through them and they don't _appear_ to be of any help. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot Run Servlets, only JSP's, Part II
Oh, yeah: My system information: Win2K, SP3 Tomcat 4.1 listening on Port 8080 -Original Message- From: Johnson, Garrett Sent: Monday, December 09, 2002 11:59 AM To: 'Tomcat Users List' Subject: Cannot Run Servlets, only JSP's I'm running through the O'Reilly (onjava.com) tutorial on deploying applications in Tomcat, and I can't seem to get servlets to work. I render JSP's just fine, but once I request a servlet, I get a an HTTP Status 404 error: The requested resource (/onjava/servlet/com.onjava.login) is not available. Does anyone have any idea why this would happen? I can include any necessary log files if requested, but I've wandered through them and they don't _appear_ to be of any help. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot Run Servlets, only JSP's
Do you have a directory structure like this? TOMCAT_HOME/webapps/onjava/WEB-INF/com/onjava/ thanks. ~ t r o y ~ -Original Message- From: Johnson, Garrett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:59 AM To: 'Tomcat Users List' Subject: Cannot Run Servlets, only JSP's I'm running through the O'Reilly (onjava.com) tutorial on deploying applications in Tomcat, and I can't seem to get servlets to work. I render JSP's just fine, but once I request a servlet, I get a an HTTP Status 404 error: The requested resource (/onjava/servlet/com.onjava.login) is not available. Does anyone have any idea why this would happen? I can include any necessary log files if requested, but I've wandered through them and they don't _appear_ to be of any help. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot Run Servlets, only JSP's (Attn: Troy)
Troy, No, actually: I've got the directory structure like this: TOMCAT_HOME\webapps\onjava\WEB-INF\classes\com\onjava\login.class Is that the problem? Is the \classes directory superfluous? Is it hiding the class files? Is perhaps the turorial, written for Tomcat 4.0, out of date on this? Is the elimination of the \classes directory something new? -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 12:02 PM To: Tomcat Users List Subject: RE: Cannot Run Servlets, only JSP's Do you have a directory structure like this? TOMCAT_HOME/webapps/onjava/WEB-INF/com/onjava/ thanks. ~ t r o y ~ -Original Message- From: Johnson, Garrett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:59 AM To: 'Tomcat Users List' Subject: Cannot Run Servlets, only JSP's I'm running through the O'Reilly (onjava.com) tutorial on deploying applications in Tomcat, and I can't seem to get servlets to work. I render JSP's just fine, but once I request a servlet, I get a an HTTP Status 404 error: The requested resource (/onjava/servlet/com.onjava.login) is not available. Does anyone have any idea why this would happen? I can include any necessary log files if requested, but I've wandered through them and they don't _appear_ to be of any help. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot Run Servlets, only JSP's (Attn: Troy)
Oh my bad...that's what I meant. -Original Message- From: Johnson, Garrett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 12:09 PM To: 'Tomcat Users List' Subject: RE: Cannot Run Servlets, only JSP's (Attn: Troy) Troy, No, actually: I've got the directory structure like this: TOMCAT_HOME\webapps\onjava\WEB-INF\classes\com\onjava\login.class Is that the problem? Is the \classes directory superfluous? Is it hiding the class files? Is perhaps the turorial, written for Tomcat 4.0, out of date on this? Is the elimination of the \classes directory something new? -Original Message- From: Campano, Troy [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 12:02 PM To: Tomcat Users List Subject: RE: Cannot Run Servlets, only JSP's Do you have a directory structure like this? TOMCAT_HOME/webapps/onjava/WEB-INF/com/onjava/ thanks. ~ t r o y ~ -Original Message- From: Johnson, Garrett [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 11:59 AM To: 'Tomcat Users List' Subject: Cannot Run Servlets, only JSP's I'm running through the O'Reilly (onjava.com) tutorial on deploying applications in Tomcat, and I can't seem to get servlets to work. I render JSP's just fine, but once I request a servlet, I get a an HTTP Status 404 error: The requested resource (/onjava/servlet/com.onjava.login) is not available. Does anyone have any idea why this would happen? I can include any necessary log files if requested, but I've wandered through them and they don't _appear_ to be of any help. -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot Run Servlets, only JSP's, Part II
The invoker servlet is commented out by default in 4.1x. Anonymous servlets are considered a security risk. There are at least three ways to manage this problem. 1. Uncomment the following in your Tomcat's web.xml file. !-- The mapping for the invoker servlet -- servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping This maps the invoker servlet and allows anonymous servlets in your application. Read the documentation concerning the security issues, and also know that this is a nonstandard feature of Tomcat. 2. Use the invoker servlet only in your web application. This has the same ramifications as the first solution, but constrained to a single application. Add the following to your /app-name/WEB-INF/web.xml !-- for anonymous servlets -- servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping 3. Add each and every servlet to the web.xml file, complete with a URL mapping. This is the preferred way. Here is an example. servlet servlet-nameexample1/servlet-name display-nameexample1/display-name servlet-classmyclasses.example1/servlet-class /servlet servlet-mapping servlet-nameexample1/servlet-name url-patternservlet/example1/url-pattern /servlet-mapping /mde/ just my two cents . . . . --- Johnson, Garrett [EMAIL PROTECTED] wrote: Oh, yeah: My system information: Win2K, SP3 Tomcat 4.1 listening on Port 8080 I'm running through the O'Reilly (onjava.com) tutorial on deploying applications in Tomcat, and I can't seem to get servlets to work. I render JSP's just fine, but once I request a servlet, I get a an HTTP Status 404 error: The requested resource (/onjava/servlet/com.onjava.login) is not available. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot Run Servlets, only JSP's, Part II (Attn: Mark)
Mark, Thank you, that sounds like exactly what it could be. And I'd prefer to do it the RIGHT way, explicitly mapping out each servlet. Just one question: WHICH web.xml file? There's one in: $CATALINA_HOME/conf/ and one in $CATALINA_HOME/webapps/myapp/WEB-INF/ Will one override the other? -Original Message- From: Mark Eggers [mailto:[EMAIL PROTECTED]] Sent: Monday, December 09, 2002 12:12 PM To: Tomcat Users List Subject: RE: Cannot Run Servlets, only JSP's, Part II The invoker servlet is commented out by default in 4.1x. Anonymous servlets are considered a security risk. There are at least three ways to manage this problem. 1. Uncomment the following in your Tomcat's web.xml file. !-- The mapping for the invoker servlet -- servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping This maps the invoker servlet and allows anonymous servlets in your application. Read the documentation concerning the security issues, and also know that this is a nonstandard feature of Tomcat. 2. Use the invoker servlet only in your web application. This has the same ramifications as the first solution, but constrained to a single application. Add the following to your /app-name/WEB-INF/web.xml !-- for anonymous servlets -- servlet-mapping servlet-nameinvoker/servlet-name url-pattern/servlet/*/url-pattern /servlet-mapping 3. Add each and every servlet to the web.xml file, complete with a URL mapping. This is the preferred way. Here is an example. servlet servlet-nameexample1/servlet-name display-nameexample1/display-name servlet-classmyclasses.example1/servlet-class /servlet servlet-mapping servlet-nameexample1/servlet-name url-patternservlet/example1/url-pattern /servlet-mapping /mde/ just my two cents . . . . --- Johnson, Garrett [EMAIL PROTECTED] wrote: Oh, yeah: My system information: Win2K, SP3 Tomcat 4.1 listening on Port 8080 I'm running through the O'Reilly (onjava.com) tutorial on deploying applications in Tomcat, and I can't seem to get servlets to work. I render JSP's just fine, but once I request a servlet, I get a an HTTP Status 404 error: The requested resource (/onjava/servlet/com.onjava.login) is not available. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
RE: Cannot Run Servlets, only JSP's, Part II (Attn: Mark)
Sorry - I was out for a bit and was a bit generic. You need to modify the one in your application: $CATALINA_HOME/webapps/myapp/WEB-INF/ There's more information about a web application at: http://localhost:8080/tomcat-docs/appdev/index.html provided you installed the documentation with Tomcat. /mde/ just my two cents . . . . --- Johnson, Garrett [EMAIL PROTECTED] wrote: Mark, Thank you, that sounds like exactly what it could be. And I'd prefer to do it the RIGHT way, explicitly mapping out each servlet. Just one question: WHICH web.xml file? There's one in: $CATALINA_HOME/conf/ and one in $CATALINA_HOME/webapps/myapp/WEB-INF/ Will one override the other? __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]