aspose file tools*
The moose likes Tomcat and the fly likes HTTP Status 404 error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "HTTP Status 404 error" Watch "HTTP Status 404 error" New topic
Author

HTTP Status 404 error

Maan Suraj
Ranch Hand

Joined: Dec 20, 2007
Posts: 299
Iam getting resource not found error.Though i knw what this error means etc, but in my case iam not able to resolve my issue.

This is my directory structure

C:\apache-tomcat-6.0.16\webapps\ch1\web-inf\classes

within web-inf i have put my web.xml file

and within classes i have put my compiled servlet class
ChServlet.class

I type the below URL in my browser :

http://localhost:8080/ch1/Serv

all seems correct but still i get below error

type Status report
message /ch1/Serv
description The requested resource (/ch1/Serv) is not available.




Web.xml file





Please help me resolve this


Man Suraj
Someone says "Impossible is nothing". The man next him says "Let me see you licking your elbow tip!"
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

Case counts. It's WEB-INF, not web-inf.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Maan Suraj
Ranch Hand

Joined: Dec 20, 2007
Posts: 299
it was originally WEB-INF, but since it was not working , i changed it to web-inf....... I have changed it again to caps now....but still not resolved....
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61648
    
  67

Random changes aren't likely to help.

Next: Sometimes, servlets in the default package work, sometimes they do not. The next thing to eliminate as a possible source of error is to put the servlet in a package other than the default.

Also, set up the Manager app and see if your web app is even running.
Maan Suraj
Ranch Hand

Joined: Dec 20, 2007
Posts: 299
I have gone through the other topic related to same error in this forum....
so i understood the way to set the manager application.......

if i simply write address http://localhost:8080/ch1/ .....still 404 error

I can run the application manager now. However i could not see /ch1 application there.Do i need to do something else?
I can only see / Welcome to Tomcat
/docs Tomcat documentation
/host-manager Tomcat Manager Application
/manager Tomcat Manager Application


above all are true as well. However i cannot see my /ch1 application.

Also there are no errors in 'TOMCAT_HOME/logs/*' folder....

I reiterate... my folder structure is like this

C:\apache-tomcat-6.0.16\webapps\ch1\WEB-INF

within WEB-INF, i have ---- web.xml
---- classes folder
---- lib folder( empty)


ChServlet.class is put in classes folder

Please help
[ September 08, 2008: Message edited by: Maan Shenoy ]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12823
    
    5
I can run the application manager now. However i could not see /ch1 application there.


Therefore we can conclude that Tomcat does not see a usable web application at this address. Log file messages on restarting Tomcat should reveal where it is going wrong.



Tch! The class file will not be found because it is not in a package.

Bill
[ September 08, 2008: Message edited by: William Brogden ]
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Originally posted by Maan Shenoy:
ChServlet.class is put in classes folder


Have you tried to put the servlet class inside a package??

Have you restarted tomcat each time you have made changes??

Try to remove the 'ch1' folder from tomcat - and (re)start tomcat. When tomcat is running watch the console (if windows) or logs/catalina.out (if UNIX/Mac/Linux) - then drop the folder 'ch1' into webapps, and see if it is been deployed.

You can also try to put a plan HTML page in the root of the 'ch1' folder, and see if you can call it.


Regards, Rene Larsen
Dropbox Invite
Maan Suraj
Ranch Hand

Joined: Dec 20, 2007
Posts: 299
The problem got resolved ...thanks for all the inputs....the problem was with my path settings of tomcat....actually there were 2 tomcats installed on my machine....a really silly one....... but anyway my issue got resolved.....


thanks again....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTP Status 404 error