• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

All Servlets 404

 
Ranch Hand
Posts: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 13
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 171
Hibernate Spring Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what URL are you requesting in browser? or how are you getting the 404 error?
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 105
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You ought to ventilate your mind and let the cobwebs out of it. Use this cup to catch the tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic