0

i have deployed my web application in WebSphere 7. this application is build using spring and jsp servlets. some times when it get deployed due to errors it shows the following attached image like errors.

enter image description here

i have handled my web application errors as follows, by redirecting the errors to spring controller.

<error-page>
    <error-code>500</error-code>
    <!--Internal server error  -->
    <location>/error.p?message=500</location>
</error-page>
<error-page>
    <error-code>403</error-code>
    <!--Forbidden  -->
    <location>/main.p</location>
</error-page>

but it only works when the web application is successfully deployed. when deployment error happens WebSphere shows full error message like above. is there any way to hide this error page and add custom error page in websphere when such deployment errors happens?

Rangana Sampath
  • 1,447
  • 3
  • 32
  • 57

1 Answers1

0

If you have an Apache server (or other) in front of your WebSphere, you may use it to redirect error 500 on a custom static web page.

Since you're using Spring, if this error can occur often, you can try to use lazy bean initialization on the remoteOMSConnectorWS (See LazyInitTargetSource). This would delay bean instantiation until its first use, most likely after webapp complete startup. In this case, your error configuration from web.xml could be used.

Guillaume Darmont
  • 5,002
  • 1
  • 23
  • 35
  • hi , thankyou for the quick response. actually i'm using spring 2.5 and the connection is set to LazyInit as follows. as you mentioned there is a IBM web server in the middle. i have configured the default error page to be shown but still facing the problem. – Rangana Sampath Jun 15 '13 at 06:54
  • actually there are two error codes shown in the error page, Error Message: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet Error Code: 500 Target Servlet: tradeweb Error Page Exception: Error Message: javax.servlet.ServletException: SRVE0207E: Uncaught initialization exception created by servlet Error Code: 0 – Rangana Sampath Jun 15 '13 at 08:57
  • `lazy-init="true"` is not really lazy if not wrapped in a `LazyInitTargetSource` (see documentation). – Guillaume Darmont Jun 15 '13 at 14:10