Results 1 to 2 of 2

Thread: Show custom error page when tomcat fails to load the spring beans

  1. #1
    Join Date
    Dec 2007
    Posts
    2

    Default Show custom error page when tomcat fails to load the spring beans

    I have a spring based application running on tomcat 5.x. I am using hibernate for Data access. My Database configuration is not right so when tomcat starts it throws up java.sql.SQLException, org.psotgressql.util.PSQLException,
    java.net.NoRouteToHostException while trying to connect to the database and it keeps throwing these exceptions even when tomcat starts.
    My Beans don't get loaded aswell. It hrows a BeanCreation Exception.
    When I try to invoke the application through a url, it gives me the tomcat error with Http status 400 and says the requested resource is not available. Instead I want to customize this error page. I am able to invoke the application if the Database configuration info is right. I badly need to load up a page when the Database configuration is not right instead of showing the default tomcat error. I would appreciate any feedback.

    Thanks

  2. #2
    Join Date
    Oct 2008
    Location
    Delhi, India
    Posts
    163

    Default

    You can configure a seperate page for 400 errors in your web.xml. I don't think it's possible to get what caused the error and display a custom page based on that.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •