• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with servlets

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have recently started working with servlets.My test servlet is not working.I'm using JDK1.4.2 & Tomcat4.1.27
I created a 'myApp' directory under M:\Apache Group\Tomcat 4.1\webapps.
And stored my 'testingServlet.class' file under
M:\Apache Group\Tomcat 4.1\webapps\myApp\WEB-INF\classes
And 'web.xml' is under M:\Apache Group\Tomcat 4.1\webapps\myApp\WEB-INF
Typing the following url
http://localhost:8080/myApp/servlet/testingServlet
gives http 404 error as below:

But the sample examples(bundled with Tomcat) are working fine.
Can somebody please tell me why is this problem occuring ?
Thank you
Raj
 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
After creating the new directory under webapp, did you restart Tomcat? Futhermore, after compiliing the new servlet, you will need to restart Tomcat (depends on setting).
HTH
 
Raj Dutta
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Yes I did restart Tomcat in all cases.
Do I have to change the conf\Server.xml ?
Thanks
Raj
[ August 23, 2003: Message edited by: Raj Dutta ]
 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the deployment descriptor (web.xml) what is the url-pattern of your servlet? Do you have it mapped appropriately? You should see:
<servlet>
<servlet-name>testingServlet</servlet-name>
<servlet-class>com.test.servlet.TestingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>testingServlet</servlet-name>
<url-pattern>servlet/testingServlet</url-pattern>
</servlet-mapping>
[ August 23, 2003: Message edited by: William Duncan ]
 
Not looking good. I think this might be the end. Wait! Is that a tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic