Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Not able to run Servlet on Tomcat

  Asked By: Violet    Date: Feb 24    Category: Java    Views: 672
  

I am not able to run Servlet on Tomcat 5.0.24
my web.xml fragment (location is webapps/SG/WEB-INF)

<servlet>
<servlet-name>passAuthen</servlet-name>
<servlet-class>passAuthen</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>passAuthen</servlet-name>
<url-pattern>/passAuthen</url-pattern>
</servlet-mapping>

I'm calling the sevlet like this
http://localhost:8080/SG/passAuthen

and my servlet class is in webapps/SG/WEB-INF/classes

Its not running, error is - The requested resource (/SG/passAuthen) is not
available.

Do i have to make changes to server.xml in conf, or any other changes required.

Could you please help me.

Share: 

 

3 Answers Found

 
Answer #1    Answered By: Clinton Edwards     Answered On: Feb 24

Everything you've shown here looks correct. Can you access your
servlet if you comment out the servlet  mapping in your web.xml file
and use the default URL-
http://localhost:8080/SG/servlet/passAuthen ?
(I'm assuming the name of your servlet class  is actually passAuthen.)

 
Answer #2    Answered By: Adelaide Fischer     Answered On: Feb 24

I did whatever you asked me to, infact i also
created a package & tried like you said... its not working. I really dont know
what to do..

infact today i made changes on conf directory - server.xml

<Context path="" docBase="webapps/SG" debug="0" reloadable="true" />

still its not working

 
Answer #3    Answered By: Blake Smith     Answered On: Feb 24

I didn't use Tomcat 5.0.X but i suggest that try with


<url-pattern>./passAuthen</url-pattern>

 
Didn't find what you were looking for? Find more on Not able to run Servlet on Tomcat Or get search suggestion and latest updates.




Tagged: