| Author |
All Servlets 404
|
sam wootton
Ranch Hand
Joined: Apr 16, 2011
Posts: 48
|
|
Hi,
Thanks in advance for any help or advice.
I have tomcat6 running locally, on Linux.
The problem i have, is that ALL webapps are 404, apart from "/" webapp. Even tomcats "examples" webapp is 404 when i click in the link in the manager.
$CATALINA_HOME = /usr/share/tomcat6
$CATALINA_BASE = /usr/share/tomcat6
When i look in:
/var/log/tomcat6/localhost_access_log.2012-04-23.txt
I see (if i click on the "examples" webapp that comes with tomcat):
When i just type localhost:8080, i get to the tomcat manager no problem. Im also running Apache webserver locally too.
Any ideas?
Regards, Sam
|
 |
sam wootton
Ranch Hand
Joined: Apr 16, 2011
Posts: 48
|
|
An example webapp i have is:
I have the dir structure:
home/sam/tomcat/webapps/musicfinder/WEB-INF/web.xml
But this is 404 too.
|
 |
sailaja koney
Greenhorn
Joined: Dec 18, 2011
Posts: 13
|
|
please try including the below tag in the web.xml file(create any index.html)
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
|
sailaja
|
 |
sam wootton
Ranch Hand
Joined: Apr 16, 2011
Posts: 48
|
|
Hi sailaja,
That didnt seem to do anything. I put:
Still have the same problem.
I think this is a bigger tomcat mapping / configuration problem, its not simply a matter of creating a default page, otherwise tomcats "example" webapp would also work?
Regards, Sam
|
 |
sailaja koney
Greenhorn
Joined: Dec 18, 2011
Posts: 13
|
|
whether the jsp-api.jar and servlet-api.jar files are set to classpath?
Normally for the first time if we run the jsp or servlets, this is the issue i faced.
i use Eclipse and tried the tomcat examples in the browser, where i had to start the tomcat server through command prompt. It worked.
and when the tomcat is running through eclipse, i got the same message error 404.
hope this will solve
|
 |
Anurag Verma
Ranch Hand
Joined: Mar 30, 2012
Posts: 118
|
|
|
what URL are you requesting in browser? or how are you getting the 404 error?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
|
Until you can get Tomcat installed such that the example apps are displaying, it's a waste of time to try and get your own apps running.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
sam wootton
Ranch Hand
Joined: Apr 16, 2011
Posts: 48
|
|
Hi,
Thank you for everyones help! Really great.
I uninstalled and reinstalled tomcat, and got the example servlets working no problem (not sure what was wrong).
I had:
tomcat/webapps/musicfinder
With this, i thought that i could have the following:
but i think my tomcat knowledge is worse than i remember, because i only way i got it to work was:
Anyway - its working now. I still have odd situation where my Servlet is called twice (sometimes 3 times), then when i restart my machine, it returns to only being called once. It doesn't happen all of the time though.
I dont know why that is - but i guess its a separate issue.
Thanks again!
Regards, Sam
|
 |
sam wootton
Ranch Hand
Joined: Apr 16, 2011
Posts: 48
|
|
oh, and sailaja i do all my tomcat dev / admin on the command line. I dont really use GUIs.
Regards, Sam
|
 |
 |
|
|
subject: All Servlets 404
|
|
|