1 Reply Latest reply on Jan 22, 2009 12:30 PM by peterj

    Configuring default error page

    pa12399

      Hi

      I am using JBoss 4.2.2

      I am trying to configure a default error handling, where the error handling component is a servelt, which will simply catch the exceptions which are not caught by the other application servlet and then log it in a specific format.

      I have created this entry in server/myapp/deploy/jboss-web.deployer/conf/web.xml

      <welcome-file-list>
      <welcome-file>index.html</welcome-file>
      <welcome-file>index.htm</welcome-file>
      <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>

      <!-- Catch a whole class of errors -->
      <error-page>
      <exception-type>java.lang.NumberFormatException</exception-type>
      /error.ErrorServlet
      </error-page>
      </web-app>

      The ErrorServlet is under ROOT.war/WEB-INF/lib/myapp.jar

      But it doesnt seem to be catching the exceptions. Instead I see the exception just getting displayed in server.log

      Any help would be greatly appreciated.

      Thank you

        • 1. Re: Configuring default error page
          peterj

          The global web.xml file, which you modified, is combined with the web.xml file for your app to make the configuration for your web app. Thus I believe it expects the servlet to be in your web app.

          You are going to have to play around with different configurations to find one that might work. A possibility might be to send the errors to an HTML page in ROOT.war (which I think you were already able to do), and have the HTML page redirect to a global servlet (since you can use a full URL there).