Fw: Re: Can't run servlets
Hi, I did what was told bt Antony. But the problem persists. Looking forward for help Regards X V Jay--- Begin Message --- declarations. Like this TestingServlet TestingServlet You have to declare the url mappings for servlets. Do this after all servlet declarations. Like this TestingServlet TestingServlet TestingServlet /TestingServlet Another way is using the invoker servlet provided by Tomcat. If using invoker servlet no need of servlet mapping. But it have security bugs and is disabled by default. Antony Paul. - Original Message - From: "X V Jay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 26, 2003 1:43 PM Subject: Can't run servlets > Hi, > I have been unable to run servelets using my tomacat. I have put the > class file in WEB-INF\classes. Please tell me where did I go wrong ? > Thank you > X V Jay > > > Here is the source > = > import javax.servlet.*; > import javax.servlet.http.*; > import java.io.*; > import java.util.*; > > public class TestingServlet extends HttpServlet { > > public void doGet(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > > PrintWriter out = response.getWriter(); > out.println(""); > out.println(""); > out.println("Servlet Testing"); > out.println(""); > out.println(""); > out.println("Welcome to the Servlet Testing Center"); > out.println(""); > out.println(""); > } > } > > > Here is the web.xml > = > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" > "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";> > > > > TestingServlet > TestingServlet > > > === > > Error message generated > == > > HTTP Status 404 - /myJspApps/servlet/TestingServlet > > -- > type Status report > > message /myJspApps/servlet/TestingServlet > > description The requested resource (/myJspApps/servlet/TestingServlet) > is not available. > > > --- > > Apache Tomcat/4.1.27 > > = > > - > 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] --- End Message --- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't run servlets
You have to declare the url mappings for servlets. Do this after all servlet declarations. Like this TestingServlet TestingServlet TestingServlet /TestingServlet Another way is using the invoker servlet provided by Tomcat. If using invoker servlet no need of servlet mapping. But it have security bugs and is disabled by default. Antony Paul. - Original Message - From: "X V Jay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, December 26, 2003 1:43 PM Subject: Can't run servlets > Hi, > I have been unable to run servelets using my tomacat. I have put the > class file in WEB-INF\classes. Please tell me where did I go wrong ? > Thank you > X V Jay > > > Here is the source > = > import javax.servlet.*; > import javax.servlet.http.*; > import java.io.*; > import java.util.*; > > public class TestingServlet extends HttpServlet { > > public void doGet(HttpServletRequest request, > HttpServletResponse response) > throws ServletException, IOException { > > PrintWriter out = response.getWriter(); > out.println(""); > out.println(""); > out.println("Servlet Testing"); > out.println(""); > out.println(""); > out.println("Welcome to the Servlet Testing Center"); > out.println(""); > out.println(""); > } > } > > > Here is the web.xml > = > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" > "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd";> > > > > TestingServlet > TestingServlet > > > === > > Error message generated > == > > HTTP Status 404 - /myJspApps/servlet/TestingServlet > > -- > type Status report > > message /myJspApps/servlet/TestingServlet > > description The requested resource (/myJspApps/servlet/TestingServlet) > is not available. > > > --- > > Apache Tomcat/4.1.27 > > = > > - > 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: Re: Can't run servlets
Thank you guys, Its now working with servlet mapping. Regards X.V.Jay > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Am Thursday 06 November 2003 09:48 schrieb Basavaraju P. Banakar: > > Servlet mapping is not madatory.. > > Well, not from the viewpoint of the DTD, but if you dont use the invoker [Jay > indicates by mentioning sepcifications], you'll need one (Otherwise > I'd really like to know why I have to use them with my Tomcat 4.1.24 > installation ;-) > > But if servlet mappings are still not enough, Jay has to check the errorlogs > of his server $TOMCAT_HOME/logs, there are a lot of possible other errors. > His servlet might have thrown an exception, some xml file might be malformed > (this would be my next guess). > > Mit freundlichem Gruß / With kind regards > Holger Klawitter > - -- > lists klawitter de > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.2.2 (GNU/Linux) > > iD8DBQE/qhCr1Xdt0HKSwgYRAgkQAJ4ko9IJsGBFZbI/YlIREOxqigZOqACfRq2s > yGRgQKyOGSNfEMPFx2n8op4= > =AXDS > -END PGP SIGNATURE- > > > - > 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: Can't run servlets
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am Thursday 06 November 2003 09:48 schrieb Basavaraju P. Banakar: > Servlet mapping is not madatory.. Well, not from the viewpoint of the DTD, but if you dont use the invoker [Jay indicates by mentioning sepcifications], you'll need one (Otherwise I'd really like to know why I have to use them with my Tomcat 4.1.24 installation ;-) But if servlet mappings are still not enough, Jay has to check the errorlogs of his server $TOMCAT_HOME/logs, there are a lot of possible other errors. His servlet might have thrown an exception, some xml file might be malformed (this would be my next guess). Mit freundlichem Gruß / With kind regards Holger Klawitter - -- lists klawitter de -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/qhCr1Xdt0HKSwgYRAgkQAJ4ko9IJsGBFZbI/YlIREOxqigZOqACfRq2s yGRgQKyOGSNfEMPFx2n8op4= =AXDS -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Can't run servlets
did u try running the examples ?? - Original Message - From: "X V Jay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 06, 2003 1:52 PM Subject: Re: Re: Can't run servlets > Even after adding a servlet-mapping after my servlet declarations the > problem is persisting. > With regards > X V Jay > > > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Am Thursday 06 November 2003 08:04 schrieb X V Jay: > > > Hi, > > > I am a newbie, I have been unable to run a servlet. These are the > steps > > > I took... > > > > > > 1. I wrote a small test servlet. > > > 2. I created a 'test' directory under webapps. > > > 3. Created WEB-INF in 'test' and put the testweb.class in classes > dir. > > > 4. Created a web.xml in WEB-INF > > > > > > > > > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > > > "http://java.sun.com/dtd/web-app_2_3.dtd";> > > > > > > > > > abcd > > > testweb > > > > > > > > > > You also need to add a servlet-mapping after your servlet > declarations: > > > > > > abcd > > /servlet/abcd > > > > > > Mit freundlichem Gruß / With kind regards > > Holger Klawitter > > - -- > > lists klawitter de > > -BEGIN PGP SIGNATURE- > > Version: GnuPG v1.2.2 (GNU/Linux) > > > > iD8DBQE/qf5M1Xdt0HKSwgYRApeXAJwLtTsABkr4xJdoVA/MSGl6NQSrxACeLiyx > > SJwz9YUQmb7G3fLzGJScS2E= > > =eoEK > > -END PGP SIGNATURE- > > > > > > - > > 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] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Can't run servlets
Holger Klawitter, Servlet mapping is not madatory.. - Basu. - Original Message - From: "X V Jay" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, November 06, 2003 1:52 PM Subject: Re: Re: Can't run servlets > Even after adding a servlet-mapping after my servlet declarations the > problem is persisting. > With regards > X V Jay > > > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Am Thursday 06 November 2003 08:04 schrieb X V Jay: > > > Hi, > > > I am a newbie, I have been unable to run a servlet. These are the > steps > > > I took... > > > > > > 1. I wrote a small test servlet. > > > 2. I created a 'test' directory under webapps. > > > 3. Created WEB-INF in 'test' and put the testweb.class in classes > dir. > > > 4. Created a web.xml in WEB-INF > > > > > > > > > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > > > "http://java.sun.com/dtd/web-app_2_3.dtd";> > > > > > > > > > abcd > > > testweb > > > > > > > > > > You also need to add a servlet-mapping after your servlet > declarations: > > > > > > abcd > > /servlet/abcd > > > > > > Mit freundlichem Gruß / With kind regards > > Holger Klawitter > > - -- > > lists klawitter de > > -BEGIN PGP SIGNATURE- > > Version: GnuPG v1.2.2 (GNU/Linux) > > > > iD8DBQE/qf5M1Xdt0HKSwgYRApeXAJwLtTsABkr4xJdoVA/MSGl6NQSrxACeLiyx > > SJwz9YUQmb7G3fLzGJScS2E= > > =eoEK > > -END PGP SIGNATURE- > > > > > > - > > 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] > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re: Can't run servlets
Even after adding a servlet-mapping after my servlet declarations the problem is persisting. With regards X V Jay > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Am Thursday 06 November 2003 08:04 schrieb X V Jay: > > Hi, > > I am a newbie, I have been unable to run a servlet. These are the steps > > I took... > > > > 1. I wrote a small test servlet. > > 2. I created a 'test' directory under webapps. > > 3. Created WEB-INF in 'test' and put the testweb.class in classes dir. > > 4. Created a web.xml in WEB-INF > > > > > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > > "http://java.sun.com/dtd/web-app_2_3.dtd";> > > > > > > abcd > > testweb > > > > > > You also need to add a servlet-mapping after your servlet declarations: > > > abcd > /servlet/abcd > > > Mit freundlichem Gruß / With kind regards > Holger Klawitter > - -- > lists klawitter de > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.2.2 (GNU/Linux) > > iD8DBQE/qf5M1Xdt0HKSwgYRApeXAJwLtTsABkr4xJdoVA/MSGl6NQSrxACeLiyx > SJwz9YUQmb7G3fLzGJScS2E= > =eoEK > -END PGP SIGNATURE- > > > - > 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: Can't run servlets
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am Thursday 06 November 2003 08:04 schrieb X V Jay: > Hi, > I am a newbie, I have been unable to run a servlet. These are the steps > I took... > > 1. I wrote a small test servlet. > 2. I created a 'test' directory under webapps. > 3. Created WEB-INF in 'test' and put the testweb.class in classes dir. > 4. Created a web.xml in WEB-INF > > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" > "http://java.sun.com/dtd/web-app_2_3.dtd";> > > > abcd > testweb > > You also need to add a servlet-mapping after your servlet declarations: abcd /servlet/abcd Mit freundlichem Gruß / With kind regards Holger Klawitter - -- lists klawitter de -BEGIN PGP SIGNATURE- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQE/qf5M1Xdt0HKSwgYRApeXAJwLtTsABkr4xJdoVA/MSGl6NQSrxACeLiyx SJwz9YUQmb7G3fLzGJScS2E= =eoEK -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Can't run servlets!
The servlets-examples explicitly use servlet-mappings for /servlet/*. The invoker servlet is disabled by default (since 4.1.12). Uncomment the for the invoker servlet in CATALINA_HOME/conf/web.xml or add this mapping to your own web.xml.or explicitly create your own servlet mappings for your servlets which is the best way to go anyway. Jake At 04:02 PM 9/2/2003 +0100, you wrote: Sorry to bother u with this one but i've working on it for three days and can't get it working! I've installed tomcat 5.0.9, can compile my own servlets and run the everything in the servlets-examples directory but when i create my own directory i can't get the servlets to run. All instructions I've read about setting the CLASSPATH variable point towards /common/lib/servlet.jar but there doesn't appear to be such a thing. I have set the CLASSPATH to /common/lib/servlet-api.jar instead. Is this correct? I would be very grateful for any help! Thanks, latin Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.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: Can't run servlets!
you shouldn't set your classpath at all. Just run the start script in TOMCAT_HOME/bin, and the rest is taken care of Filip - Original Message - From: "Latin Mirambeau" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, September 02, 2003 8:02 AM Subject: Can't run servlets! Sorry to bother u with this one but i've working on it for three days and can't get it working! I've installed tomcat 5.0.9, can compile my own servlets and run the everything in the servlets-examples directory but when i create my own directory i can't get the servlets to run. All instructions I've read about setting the CLASSPATH variable point towards /common/lib/servlet.jar but there doesn't appear to be such a thing. I have set the CLASSPATH to /common/lib/servlet-api.jar instead. Is this correct? I would be very grateful for any help! Thanks, latin Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger http://uk.messenger.yahoo.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: Can't run servlets!
Thanks for your help! I will try to give you some answers - Tomcat 3.2, Apache 1.3.2 I have mod_jk settings I have not modified workers.properties. I have set server.xml and web.xml. Now I am using one properties file which I have kept in tomcat in my project dir along with html files. Tomcat is giving me error that the properties file not found. Where should I put my custom properties file which is being referenced by my code? Thanks Gauri -Original Message- From: Tony Vinayak [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 12:20 PM To: [EMAIL PROTECTED] Subject: RE: Can't run servlets! O you need to tell us lot more than that Gauri! - What error do you get? - What versions of Apache, Tomcat, OS? - What mod_jk config settings in httpd.conf? - What's in your workers.properties (in case you've modified the defaults) - In your server.xml? - In your web.xml? Questions, questions! - Tony -Original Message- From: Gauri Tuljapurkar [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 12:52 PM To: [EMAIL PROTECTED] Subject: Can't run servlets! I have set up a tomcat and apache server. I can run sample jsp files but not my servlets. I appreciate your help! Gauri
RE: Can't run servlets!
O you need to tell us lot more than that Gauri! - What error do you get? - What versions of Apache, Tomcat, OS? - What mod_jk config settings in httpd.conf? - What's in your workers.properties (in case you've modified the defaults) - In your server.xml? - In your web.xml? Questions, questions! - Tony -Original Message- From: Gauri Tuljapurkar [mailto:[EMAIL PROTECTED]] Sent: Friday, September 14, 2001 12:52 PM To: [EMAIL PROTECTED] Subject: Can't run servlets! I have set up a tomcat and apache server. I can run sample jsp files but not my servlets. I appreciate your help! Gauri