• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setup tomcat6 folders in ubuntu

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

thank you
---------------
ps:

this is the error I get
type Status report

message /servlet/AllStudents

description The requested resource (/servlet/AllStudents) is not available.

i tried everything but nothing works
please help!
 
Saloon Keeper
Posts: 27861
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, "sa pr".

One thing you haven't tried is using a real name on your request. We don't have a lot of rules on the CodeRanch forums, but one that we do insist on is a proper display name.

Here's more info: http://www.javaranch.com/name.jsp
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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:

ch1/
|
WEB-INF/
|
classes/ web.xml
|
Ch1Servlet.class

My web.xml file is the following:



My Ch1Servlet.java file is as follows:



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
 
John Deal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
John Deal
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic