I am serializing all the data in the session and storing the session data outside the JVM using tomcat persistence manager in the DB tables. Without persistence manager everything is working fine. But with the perisitence manager for this session storage. I am getting the following error when i click on any links in my web application.
Exception thrown during phase execution: javax.faces.event.PhaseEvent[source=com.sun.faces.lifecycle.LifecycleImpl@719abade]
viewId:/pages/foo.jsf - View /pages/foo.jsf could not be restored.
I've added the following to my web.xml
<context-param>
<param-name>com.sun.faces.enableRestoreView11Compatibility</param-name> <param-value>true</param-value>
</context-param>
Adding above configuration will solve the exception but the problem is click on any links don't work or it will not respond until i refresh the page. Seems some JSF life cycle issue. I am implementing PhaseListener
to my class called JSFPhaseListener
and configured that in faces-config.xml
So I am thinking that this life cycle issue can be solved by doing something in my JSFPhaseListener
class. Someone please help me to solve this one. My JSFPhaseListener
class is given below.
public class JSFPhaseListener implements PhaseListener {
@Override
public PhaseId getPhaseId() {
return PhaseId.RENDER_RESPONSE;
}
@Override
public void beforePhase(PhaseEvent event) {
// Do your job here which should run right before the RENDER_RESPONSE.
}
@Override
public void afterPhase(PhaseEvent event) {
// Do your job here which should run right after the RENDER_RESPONSE.
}
}