This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Tomcat 7.0.39 giving HTTP Status 404 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 7.0.39 giving HTTP Status 404" Watch "Tomcat 7.0.39 giving HTTP Status 404" New topic
Author

Tomcat 7.0.39 giving HTTP Status 404

Sayan Khasnabis
Greenhorn

Joined: May 01, 2013
Posts: 3
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

Joined: Apr 29, 2011
Posts: 75

any exceptions in tomcat logs? Could be your application is not deployed due to some errors.
Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
    
    1
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

Joined: Mar 22, 2000
Posts: 12761
    
    5
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

Joined: May 01, 2013
Posts: 3
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

Joined: Apr 19, 2013
Posts: 199
    
    1
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

Joined: Jan 10, 2002
Posts: 60797
    
  65

Have you worked through the list in the ServletsFaq on this issue?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sayan Khasnabis
Greenhorn

Joined: May 01, 2013
Posts: 3
Ok .. will surely go through it.

Thanks and regards.
 
 
subject: Tomcat 7.0.39 giving HTTP Status 404
 
Similar Threads
FAIL - Application at context path
abt tomcat 404 error ..
Vista caching and Tomcat
Getting Prob to deploy new application under tomcat
Tomcat 4.0 and JSP- problem using beans