Hello everyone, I am new to this forum and also to tomcat.
I have been trying and searching for 3 days and with no success and i have an assignment due in a week,reason why i wanted to setup tomcat at home so I can do some work at home.
I have installed jdk and I can deploy java files use the command javac filename.java
actually everything works perfectly in the university but at home I do have some problem which seems to come from some sort of wrong configuration.
I cant run servlets, I can run website which are in the folder ROOT but then i have a WEB-INF/classes/ folder which contains all the classes and the string to call them is
<form action="/servlet/AllStudents" method="get">
when i do this it says the requested resource is not available, how do it set my tomcat in order to read the classes inside the folder classes and call them using /servlet/name of the class ?
i hope someone can help
this is the error I get
type Status report
description The requested resource (/servlet/AllStudents) is not available.
I have the same basic problem except I am just trying to execute a simple servlet directly. I am following the book Head First Servlets and JSP, Second Edition pages 30-31 (at least those are the pages indicated in Safari Books). I am using Ubuntu 10.04 and installed Tomcat6 as well as the administration application. Doing http://localhost:8080/ gives me the Tomcat welcome page so it is running. I also can run http://localhost:8080/manager/html/ successfully. I created the following directory/file hierarchy in /usr/share/tomcat6/webapps:
When in Firefox I try to access the address: http://localhost:8080/ch1/Serv1 I get the 404 error in part stating the following: "The requested resource (/ch1/Serv1) is not available." I also do not see it in the list of applications in the Tomcat GUI management application (not surprised there).
BTW this is not deployed as a WAR file. It is just the built directories with files copied. I restarted Tomcat several times to see if it would pick-up the new servlet but it does not seem too. Does anyone have any ideas? Am I placing my servlet in the correct directory?
Thanks. I am not the original poster here and I hope my real name shows up
SCJP 1.4, SCJD 1.5
Joined: Sep 07, 2006
There is an error on line 5 of the web.xml file. The end ">" is missing (thank you W3 Validator). Sorry for any inconvenience. Still does not work. Can't seem to find the servlet.
Joined: Sep 07, 2006
Got my servlet to work. There are a few problems but the main one is I was deploying to the wrong directory. It seems the correct directory for Ubuntu 10.04 Tomcat 6 is /usr/lib/tomcat6/webapps. This was not obvious from the documentation that I read or the book.
One other interesting issue is I got an error with my web.xml file on setting the encoding attribute to "ISO-8850-1" which was given in the example in the book "Head First Servlets and JSP, Second Edition". I installed tomcat6-examples and they used "ISO-8859-1" and that seem to work.