Meaningless Drivel is fun!
The moose likes Servlets and the fly likes problem in running first servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problem in running first servlet" Watch "problem in running first servlet" New topic

problem in running first servlet

Pandurang Kekhale

Joined: Dec 27, 2007
Posts: 2
Thanks for reading this post.

This is first time I am trying to run Servlet using jakarta-tomcat-5.0.28 I have followed steps from this article, and I am using http://localhost:8080/myApp/servlet/Testing url to run it in firefox but getting following error :

HTTP status 404 - The requested resource (/myApp/servlet/Testing) is not available.

Is there anything else to do, apart from this settings.

Please help me guys.
Imtiyaz Ahmed

Joined: Dec 03, 2007
Posts: 3
have you mentioned url pattern correctly in Deployment Descriptor?

make sure you have written DD correctly and your servlet is in correct directory structure.
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

What this article does not show you is that you need to enable Tomcat's InvokerServlet. To do so, edit the web.xml file in your tomcat's conf directory (%TOMCAT_HOME%/conf/web.xml). Search the word "invoker" in this file.

1. You need to uncomment the invoker servlet
2. You need to uncomment the servlet mapping for the invoker
I let you figure out where both sections are. If you look for the word "invoker", you'll find them both.

Restart Tomcat, and retry to access your servlet.

[My Blog]
All roads lead to JavaRanch
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Mallinath Adki, pleas refrain from posting in all uppercase. Please read this for more information.

[Asking smart questions] [About Bear] [Books by Bear]
Pandurang Kekhale

Joined: Dec 27, 2007
Posts: 2
Thank you Guys.

especially thanks to Christopher verre .. I did it man! I was missing to uncomment the servlet mapping for invoker of conf/web.xml.

Now I am able to run it using this url http://localhost:8080/myApp/servlet/TestingServlet

Thank you!!
[ January 03, 2008: Message edited by: Pandurang Kekhale ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Before moving forward, you might want to find out why the InvokerServlet was disabled and how you can deploy your servlets without it.

This article covers it pretty well.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: problem in running first servlet
It's not a secret anymore!