aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "problems with deploying servlet" Watch "problems with deploying servlet" New topic
Author

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
<servlet>
<servet-name>LuckyNumberServlet1</servlet-name>
<servlet-class>LuckyNumberServlet1</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>LuckyNumberServlet1<servlet-name>
<url-pattern>/servlet/LuckyNumberServlet1</url-pattern>
</servlet-mapping>
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
Radha
Preetham Chandrasekhar
Ranch Hand

Joined: Nov 05, 2003
Posts: 98
ok....
im kinda new too..lemme try to help you....
servlet-mapping>
<servlet-name>LuckyNumberServlet1<servlet-name>
<url-pattern>/servlet/LuckyNumberServlet1</url-pattern>
</servlet-mapping>
try changing the following:
http://localhost:8080/servlet/LuckyNumberServlet1
since u have given your url-pattern as /servlet/LuckyNumberServlet1 jus add this...as 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
hmmm....
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 out...it would get u close to the err.
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
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 ]

Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
See the invoker servlet FAQ here at the ranch.
Plus an incredible number of similar conversations in the last 2 weeks.
Bill
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.

Thanks.
[ June 12, 2007: Message edited by: Hari priya ]
 
jQuery in Action, 2nd edition
 
subject: problems with deploying servlet