Tomba Rakesh wrote:
public class ProfilerValveImpl extends AbstractValve
implements PageProfilerValve {
....
....
public void invoke( RequestContext request, ValveContext context )
throws PipelineException {
try {
....
....
} catch( SecurityException se ) {
if( ( request.getRequest( ).getUserPrincipal( ) == null ) &&
( request.getPath( ) != null ) &&
!request.getPath( ).equals( "/" ) ) {
try {
/******************************************************
My Comment: When Application DB down. This block redirect
to jetspeed default page.
*******************************************************/
request.getResponse().sendRedirect(request.getRequest().getContextPath());
} catch( IOException ioe ) {
}
return;
}
...
...
}
}
Are you trying to redirect to a servlet page if Jetspeed fails to
initialize? (such as when the database is down)
If yes, I think you are on the right track to fixing an 'user
experience' problem: displaying stack traces to the end user. For
example, If I change my database connection to a bad setting, and then
try to hit the portal, I get this in my browser:
javax.servlet.ServletException: Failed to initalize jetspeed.
org.apache.jetspeed.exception.JetspeedException: Unable to create Engine
org.apache.jetspeed.engine.JetspeedServlet.doGet(JetspeedServlet.java:206)
javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
Ugly.
I propose that the Jetspeed engine always completes initialization, even
on error conditions. The engine will have 'state' attribute to
determine if the engine is running or in
engine.getState()
returning states such as RUNNING, INITIALIZING, DOWN, ERROR
Then a valve can check the engine state, and redirect to servlet pages
based on the state, or pass thru on the RUNNING state.
This leads to an interesting challenge: what if the database comes up?
Should we just restart the app server?
Thats certainly the easiest solution.
A retry thread would be another solution
Well, I didn't mean to hijack your thread and sorry if I got off topic.
I hope we are trying to solve the same problem.
Im going to create a JIRA issue to further explore the engine state feature
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]