jQuery in Action, 3rd edition
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question about example in SCWCD Exam Study Kit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question about example in SCWCD Exam Study Kit" Watch "Question about example in SCWCD Exam Study Kit" New topic

Question about example in SCWCD Exam Study Kit

joe black
Ranch Hand

Joined: Dec 03, 2003
Posts: 103
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

Joined: Oct 18, 2000
Posts: 4121

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.

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Satishkkk Kumar

Joined: Jun 21, 2005
Posts: 1
I am new to New to java. I am getting the same problem. My log is showing the meessages

INFO: JK: ajp13 listening on /
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

Joined: Dec 04, 2004
Posts: 951

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)


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
I agree. Here's the link: http://aspose.com/file-tools
subject: Question about example in SCWCD Exam Study Kit
jQuery in Action, 3rd edition