• 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

Question about example in SCWCD Exam Study Kit

 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just started reading 'SCWD Exam Study Kit.' I'm trying to get the hello world servlet to work in the first chapter, but Tomcat 5 gives me the message "The requested resource (/chapter01/servlet/HelloWorldServlet) is not available." What am I missing?
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If there was a problem parsing your web.xml deployment descriptor (or any of several other problems) Tomcat won't load your web-app, so the servlet won't "exist". Error messages go into the logs in the TomcatDirectory/logs directory... check for any error stack traces related to your application.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am new to New to java. I am getting the same problem. My log is showing the meessages

INFO: JK: ajp13 listening on /0.0.0.0:8009
Jun 21, 2005 11:09:28 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/140 config=null
Jun 21, 2005 11:09:28 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jun 21, 2005 11:09:29 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2953 ms
Jun 21, 2005 11:56:33 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/chapter01]

I am using the example from the book. Thanks in advcance for any help.
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This happens when we use the Tomcat 5 or later. The reason is the default sevlet handling invoke servlet is disabled for this versions. so the url os the type ..../servlet/somservlet will not execute by default. We have to define the <servlet-mapping> in the web.xml for the servlet. Without <servlet-mapping> it will not map the servlet to URL.

Yo can uncomment the default Invoker servlet which define the mapping <servlet-mapping>/servlet/*</servlet-mapping>. I had tried this, but I forgot where I had uncommented this. ( I think in default web.xml)

Thanks
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic