hi. you say that you added the <servlet></servlet> tag to the * bottom * of
your Deployment Descriptor file, the web.xml. Now I hope that you know -- u
should know -- that that it is the very * first * thing contained in a
web.xml file and you also need the <servlet-mapping> tag right under that.
It contains the <servlet-name> and the <url-pattern> tags. Hope that that
helps you to "fly right" with trying to get the servlet viewed in Tomcat.
----- Original Message -----
From: "cuco2772" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Wednesday, December 19, 2007 3:43 PM
Subject: Configuring tomcat, servlet not found error
I keep getting this error:
'The requested resource (/servlet/HelloServlet) is not available'. (404)
The servlet is not getting located by tomcat for some reason. This happens
when I go to localhost:8080/servlet/HelloServlet.
The servlet engine is running, tomcat is running.
I did this:
javac -classpath
/usr/local/tomcat/apache-tomcat-6.0.14/lib/servlet-api.jar
HelloServlet.java
and I was able to at least compile the servlet into a .class file.
If you have tomcat installed, there should be an html document on how to
configure it somewhere like here :
file:///usr/local/tomcat/apache-tomcat-6.0.14/webapps/docs/config/server.html
I've been studying this document trying to figure out what I need to do,
but
so far to no avail.
I added the folowing Context element to my context.xml, located in
$CATALINA_HOME/conf:
<Context path="" docBase="webapps/ROOT" debug="0" reloadable="true"
crossContext="true">
</Context>
My HelloServlet.class is located in .../webapps/ROOT/WEB-INF/classes
In addition I added the following element to the bottom of my
..../webapps/ROOT/WEB-INF/web.xml to try to provide some sort of servlet
mapping, I think:
<servlet>
<servlet-name>HelloWorld</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
I got this info mostly from doing Google research, so I dont know
how well this applies. The only thing I can think of at this point is
maybe
I need to set my
java -classpath also, but attempts to set it to my .../classes directory
fail. I'm not sure exactly what it needs to be set to, and if you have
to provide a .class filename every time. Could anybody help clarify
some of this ? Thanx
--
View this message in context:
http://www.nabble.com/Configuring-tomcat%2C-servlet-not-found-error-tp14425976p14425976.html
Sent from the Tomcat - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]