Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: EE-1.8.2.GA_P03
-
Fix Version/s: 1.8.3, EE-1.8.2.GA_P04
-
Component/s: Framework
-
Labels:None
-
Environment:Seam 2.2, Weblogic 10.3.5, just-ice.jar + RunnableRenderer run() fix
Description
The following exception is thrown when attempting a push to a non existent view after session expiry. This exception has no functional impact but does clutter the log files. Full exception attached to the case.
[ERROR] 04:34 (PersistentFacesState.java:execute:295)
Exception occured during execute push on Unknown View
javax.faces.FacesException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:128)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:102)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:286)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:312)
....................
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:175)
at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:76)
at com.icesoft.faces.application.D2DViewHandler.restoreView(D2DViewHandler.java:258)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:179)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
There are two ways to reproduce the issue in the sample:
1. Bounce the server, reload the page via the NIC popup, and click the link to request a session render.
2. Wait for the session to expire, reload, and again click the link to call the SessionRenderer.
The just-ice.jar being used (SVN details below), has a fix that does reduce the frequency of the exception, which previously was being thrown after each requestRender call. The added fix was to add an extra catch block to the run() in RunnableRenderer like so:
} catch (FacesException e) {
renderable.renderingException(new TransientRenderingException(e));
}
[ERROR] 04:34 (PersistentFacesState.java:execute:295)
Exception occured during execute push on Unknown View
javax.faces.FacesException: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:128)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:102)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.execute(PersistentFacesState.java:286)
at com.icesoft.faces.webapp.xmlhttp.PersistentFacesState.executeAndRender(PersistentFacesState.java:312)
....................
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1937)
at com.sun.faces.application.StateManagerImpl.restoreView(StateManagerImpl.java:175)
at org.jboss.seam.jsf.SeamStateManager.restoreView(SeamStateManager.java:76)
at com.icesoft.faces.application.D2DViewHandler.restoreView(D2DViewHandler.java:258)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:179)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
There are two ways to reproduce the issue in the sample:
1. Bounce the server, reload the page via the NIC popup, and click the link to request a session render.
2. Wait for the session to expire, reload, and again click the link to call the SessionRenderer.
The just-ice.jar being used (SVN details below), has a fix that does reduce the frequency of the exception, which previously was being thrown after each requestRender call. The added fix was to add an extra catch block to the run() in RunnableRenderer like so:
} catch (FacesException e) {
renderable.renderingException(new TransientRenderingException(e));
}
From mojarra Phase.java
} catch (Exception e) {
{ this.getId().toString(), ((context.getViewRoot() != null) ? context.getViewRoot().getViewId() : ""), event}if (LOGGER.isLoggable(Level.SEVERE)) {
LOGGER.log(Level.SEVERE,
"jsf.lifecycle.phase.exception",
new Object[]
);
}
ex = e;
} finally {
Any Exception that occurs during execution is logged, and ICEfaces has no way of knowing that the view cannot be restored prior to attempting the view restoration, so the other alternative would be to disable SEVERE logging on com.sun.faces.lifecycle.Phase.