WebObjects 5.2: How to Prevent a Deadlock When a Direct Action Raises an Exception

If a Direct Action loads a session, then throws an exception, the WebObjects application stops responding ("hangs") the next time that same session is accessed.
Symptom

If a Direct Action loads a session, then throws an exception, the WebObjects application stops responding the next time that session is accessed. Normally, the WOException page should return. However, it appears as if the link to the Direct Action is clicked and the application never returns. The application stops responding immediately if the concurrent request handling flag is disabled, or eventually, if the concurrent request handling flag is enabled.

The client browser would time out and show the message "No instance available" instead of the exception page.


Solution

The workaround is to manually present the exception page instead of depending on WebObjects to present the default WOException page when an exception is raised.

In the WOApplication subclass, override the handleActionRequestError method as follows:

public WOResponse handleActionRequestError(WORequest aRequest, Exception exception, String reason, WORequestHandler aHandler, String actionClassName, String actionName, Class actionClass, WOAction actionInstance)

{
   return handleException(exception, actionInstance.context());
}

Published Date: Feb 18, 2012