Connecting Tech Pros Worldwide Forums | Help | Site Map

Servlet is not running

Member
 
Join Date: Mar 2008
Posts: 35
#1: Jun 27 '08
Hi all

I have installed tomcat5 server and also jdk.1.5.0 and set the classpath, path catalina_home and java_home variables. I wrote a HelloServlet.java , compiled it and copied the class file to tomcats webapps\root\web-inf\classes folder but when i type the url in the browser like

http://localhost:8080/servlet/HelloServlet

it shows the error
The requested resource (/servlet/HelloServlet) is not available.

Plz help me.

Thanx n regards,
Aradhana

Needs Regular Fix
 
Join Date: Aug 2007
Posts: 283
#2: Jun 27 '08

re: Servlet is not running


Are you using any IDE? why are you copying the class file and placing it in the tomcat directory?

Normally the above error occours when you have not set the mapping(web.xml) correctly or the URL is not right. Go through a helloworld servlet tutorial that runs from the command prompt. This will give you an idea on how to create a directory structure,configure tomcat to run your servlet.
Member
 
Join Date: Mar 2008
Posts: 35
#3: Jun 27 '08

re: Servlet is not running


Quote:

Originally Posted by ajos

Are you using any IDE? why are you copying the class file and placing it in the tomcat directory?

Normally the above error occours when you have not set the mapping(web.xml) correctly or the URL is not right. Go through a helloworld servlet tutorial that runs from the command prompt. This will give you an idea on how to create a directory structure,configure tomcat to run your servlet.


No I m not using any IDE. I am actually following the procedure to run a servlet as I find from a reply in the forum java.sun.com. what changes should I made to web.xml. Plz tell me.

Thanx n Regards,
Aradhana
Member
 
Join Date: Mar 2008
Posts: 35
#4: Jun 28 '08

re: Servlet is not running


My problem got solved by making the changes in servlet mapping in web.xml ..

Thanx n Regards,
Aradhana
Reply