• 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

error-page element not working in web.xml

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an application deployed on an old version Oracle Application Server (10.1.2.3.0). I have an error-page element in my web.xml to point all java.lang.Exception's to an error page. But it's not working and I don't know why. Here is my web.xml. Can anyone see anything wrong with it?

 
Rob Micah
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks as though for some reason the app server does not like both the error-page element and the ejb-local-ref element to appear in the same file. If I take out the ejb-local-ref element then the error-page element functions correctly. Adding it back in causes it to not work once again. Is there something I'm missing here?
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your web.xml file is declared as using the Servlet 2.2 DTD.

ejb-local-ref was introduced with Servlet 2.3

What version of the Servlet spec does this Oracle Application Server support?

You can answer that question with this snippet of JSP:



If it is 2.3, you can change the DTD Definition of your web.xml file to:


If it is 2.2, then you can't use ejb-local-ref with this server.
 
Rob Micah
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Running that code in a jsp shows this:



Unfortunately changing my dtd to 2.3 still doesn't resolve the problem. Here's an example of one of my ejb-local-ref definitions:


I just don't see anything wrong with it. Do you?
 
Rob Micah
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have figured out part of the problem. In my exception handler I was catching all exceptions and executing a sendError() on the response:


When I took that code out the error-page worked. However, using a error-code of 500 is not working and according to the documentation it should. In addition to that my error message in the sendError isn't appearing. Anything I'm missing?
 
Rob Micah
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Getting closer. When I change the error returned to 501 instead of 500 the error-page works. Is there some special configuration I could be missing?
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic