• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about example in SCWCD Exam Study Kit

 
joe black
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • 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?
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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.
 
Satishkkk Kumar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • 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.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic