Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 7.0.39 giving HTTP Status 404

 
Sayan Khasnabis
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I installed tomcat 7.0.39 in ubuntu and tomcat seems to be running fine but it's giving me a 404 error everytime I am trying to run a deployed application.I was following the examples from Head First Servlets and JSP and I wrote the servlet example given in Chapter 1.I checked with the tomcat logs and everything seems to be alright but still the problem persists.I have downloaded and extracted tomcat under /usr/share/ directory and set the JAVA_HOME and CATALINA_HOME to java and tomcat directory respectively set under /etc/environment/

I tried running from eclipse but still the problem remains the same.

Can someone tell me what went wrong?

Thanks,

Sayan
 
K. Gil
Ranch Hand
Posts: 75
Java Linux Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any exceptions in tomcat logs? Could be your application is not deployed due to some errors.
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

If tomcat starts properly check if your app is correctly deployed with the tomcat admin console
list deployed apps


Best regards,
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13047
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
404 means Tomcat does not find a servlet to match your URL.

Most common causes are:

1. failure to put the servlet Java code in a package - Tomcat not able to find the class file if you didn't use a package.
-or-
2. failure to correctly set up the web app directories
-or-
3. especially to configure the web.xml deployment descriptor.

Bill
 
Sayan Khasnabis
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the early reply ..I checked the deployment descriptor,looked fine to me ..tomcat application manager displayed the deployed apps and mine was listed.Tried to run it from there but still faced the same problem.I used netstat to check for any other applications which might be using the same port number as tomcat.There was none,but I still went ahead and changed the port values and tried and it started working.Anyway now its running but still couldn't figure it out what really caused the problem.
 
Carles Gasques
Ranch Hand
Posts: 199
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Add a index.jsp or index.html to your app, at least you have to be able to see a welcome file if the app is correctly deployed.
Then you could sort out why the servlet is not responding to the url you invoke, probably is a misspelling of the url or in the web.xml descriptor.


Best regards,
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64188
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you worked through the list in the ServletsFaq on this issue?
 
Sayan Khasnabis
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok .. will surely go through it.

Thanks and regards.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic