Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat Welcome ROOT web app problems - only some content displaying

 
Rebeccah Quevedo-Prastein
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This started out being a question about configuring a custom 404 error page when the URL doesn't match a webapp context, but has morphed.

I have Tomcat 6. I haven't actually deployed my web app yet. I've got the docs app, the manager app, and the "Welcome to Tomcat!" ROOT app.

Regarding my original problem, adding a simple custom error html page and adding the <error-page> element to web.xml didn't work (still get tomcat default 404 page with http://localhost:8080/anything).

So I tried just looking at the error page itself: Http://localhost:8080/error404.html.
Nope, that gets a tomcat 404 error, too.
So does http://localhost:8080/RELEASE-NOTES.txt, which comes with the application and *should* work. It displays fine in an older version of Tomcat running on another server.
WTF?

Now, the following URLs do display correctly
http://localhost:8080
http://localhost:8080/
http://localhost:8080/index.html
http://localhost:8080/index.jsp
http://localhost:8080/asf-logo-wide.gif
http://localhost:8080/tomcat.gif
http://localhost:8080/tomcat-power.gif

All of these are related to the display of the welcome page.
Nothing else displays.

Now, it's quite possible that I hosed something while playing around trying to figure out where to put the custom error pages, but WHAT could I have hosed? I've tried removing the temp file, removing the work file, restarting tomcat.

This is very frustrating, not to mention a big waste of time for something so simple.

Any suggestions?

Thanks,

Rebeccah
 
Rebeccah Quevedo-Prastein
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arrgh.

OK, some files but not others because my browser was caching.

But now, after I put everything back the way it was, why:
If I copy everything from the default web.xml into the ROOT webapp's web.xml, does the ROOT webapp stop finding the pages?

The only thing that was in the ROOT webapp was the display-name and the description, and I kept those. It's supposed to take the information from the default one.

Hmm. Maybe relative paths play a role, since the default one was in conf, and the ROOT one is in WEB-INF? No, there are no references that I see to locations on the server. Frustrating.

Rebeccah
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why did you copy the contents of the default web.xml? It's the default -- repeating it in the individual apps is not only unnecessary but discouraged.
 
Rebeccah Quevedo-Prastein
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was experimenting, thinking maybe the code I was adding was somehow not getting itself inserted in the right order into the default code, but it didn't help to identify what the problem was.

I still don't know what the problem was, and can only assume I must have made a typo when I was working on this last week, because I tried again yesterday and everything went fine. Go figure.

Rebeccah
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic