Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

All Servlets 404

 
sam wootton
Ranch Hand
Posts: 94
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 94
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
sam wootton
Ranch Hand
Posts: 94
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 167
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what URL are you requesting in browser? or how are you getting the 404 error?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64712
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sam wootton
Ranch Hand
Posts: 94
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 94
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh, and sailaja i do all my tomcat dev / admin on the command line. I dont really use GUIs.

Regards, Sam
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic