Is this one of those times where a catch Exception would be appropriate? This way regardless of what exception may be raised on attempting to clear a particular portlet's state, recovery and workflow continuation occur. Introduction of additional catches seems to indicate that really the intent here is to apply recovery regardless of what may go wrong.
try {
PortletStateManager.clearState(windowImpl);
}
catch (IllegalStateException ise) {
//Ignore an illegal state when the PortletStateManager tries to
//access the session if it has already been destroyed.
log.info("Attempted to clear state for window " + windowImpl + " but ISE indicates session had already been destroyed.", ise);
} catch (Exception e) {
// no matter what went wrong clearing state, there's nothing we can do // about it, and it's desirable to recover and continue the workflow.
log.error("Error clearing state for window " + windowImpl, e);
}
https://lists.wisc.edu/read/messages?id=1843527#1843527
catch (IllegalStateException ise) {
//Ignore an illegal state when the PortletStateManager tries to
//access the session if it has already been destroyed.
if (log.isDebugEnabled()) { log.debug("IllegalStateException attempting to clear portlet state for windowImpl " + windowImpl); }
}
We are now seeing this message in our logs.
Tomcat 5.5.17