• 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

problems with deploying servlet

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Hari priya
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Preetham-
I tried that too. But it is still not working!!
 
Preetham Chandrasekhar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Anderson gave himself the promotion. So I gave myself this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic