File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes problems with deploying servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "problems with deploying servlet" Watch "problems with deploying servlet" New topic

problems with deploying servlet

Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
Hi all -
I am new to the servlet technology. I am trying to deploy my servlet. for this purpose, I am using tomcat 5 on windows XP.
I have place my LuckyNumberServlet1 class file in servlets-examples/web-inf/classes
and modified my web.xml to
and I am trying to access it by http://localhost:8080/servlets-examples/servlet/LuckyNumberServlet1
but I am getting an error HTTP Status 404 - /servlets-examples/servlet/LuckyNumberServlet1
I have tried various ways but I still end up getting the same error. Can some one please let me know where I am doing wrong?
Thanks in advance
Preetham Chandrasekhar
Ranch Hand

Joined: Nov 05, 2003
Posts: 98
im kinda new too..lemme try to help you....
try changing the following:
since u have given your url-pattern as /servlet/LuckyNumberServlet1 jus add shown above...

My question to all members is.....say if u r planning to deploy a servlet, should you go and specify the servlet name and class in the web-xml? coz i didnt have to and it still worked when i deployed it. When do you modify the web-xml and when would u not?

"In theory, there is no difference between theory and practice. But, in practice, there is."<br /> - Jan L.A. van de Snepscheut
Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
Hi Preetham-
I tried that too. But it is still not working!!
Preetham Chandrasekhar
Ranch Hand

Joined: Nov 05, 2003
Posts: 98
are u running the tomcat from command line.....what is the error its giving in the command line? does it say class file missing or something? check it would get u close to the err.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1506
Verify that the invoker servlet is not disabled in Tomcat. You may also want to put your classes in a package and then create a webapp to hold your files. It just makes things a whole lot easier.
[ April 16, 2004: Message edited by: Bosun Bello ]

So much trouble in the world -- Bob Marley
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 12681
See the invoker servlet FAQ here at the ranch.
Plus an incredible number of similar conversations in the last 2 weeks.
Hari priya
Ranch Hand

Joined: Mar 11, 2004
Posts: 134
Hi -

I have tried uncommenting the invoker servlet but it doesn't work. The worst part is, I have commented it back and still doesn't work. I could not even load the other examples (in the servlets-examples folder) which otherwise used to work normally.

Please let me know anything that I should do. I don't think I was mishandling my web.xml 's.

[ June 12, 2007: Message edited by: Hari priya ]
I agree. Here's the link:
subject: problems with deploying servlet
Similar Threads
404 error
new errors!
Servlet not showing up in Browser
How to set conf file file
Having trouble getting Tomcat up and running