| Author |
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
Bartender
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.
|
-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
|
 |
Satishkkk Kumar
Greenhorn
Joined: Jun 21, 2005
Posts: 1
|
|
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
Joined: Dec 04, 2004
Posts: 950
|
|
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
|
Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
|
 |
 |
|
|
subject: Question about example in SCWCD Exam Study Kit
|
|
|