Technote (troubleshooting)
Problem(Abstract)
The JSF validation does not work in a JSF 2.0 portlet on WebSphere Portal Server version 8.0 with partial state saving set to true .
Cause
In the restoreView phase, the view can not be restored when the partial state saving is set to true, and thus the portlet is not rendered.
Diagnosing the problem
A NullPointerException is reported on the console at runtime for a JSF 2.0 portlet project with JSF validation enabled. The exception is reported for portlet facelet components.
[10/1/12 14:26:30:358 IST] 0000005e SystemErr R java.lang.NullPointerException: state
[10/1/12 14:26:30:359 IST] 0000005e SystemErr R at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1719)
[10/1/12 14:26:30:359 IST] 0000005e SystemErr R at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1401)
[10/1/12 14:26:30:359 IST] 0000005e SystemErr R at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1444)
[10/1/12 14:26:30:359 IST] 0000005e SystemErr R at javax.faces.component.UIViewRoot.processRestoreState(UIViewRoot.java:731)
[10/1/12 14:26:30:360 IST] 0000005e SystemErr R at com.ibm.faces20.portlet.FacesPortlet.restoreViewState(FacesPortlet.java:1083)
[10/1/12 14:26:30:360 IST] 0000005e SystemErr R at com.ibm.faces20.portlet.FacesPortlet.restoreViewState(FacesPortlet.java:1107)
[10/1/12 14:26:30:360 IST] 0000005e SystemErr R at com.ibm.faces20.portlet.FacesPortlet.restoreView(FacesPortlet.java:1557)
[10/1/12 14:26:30:360 IST] 0000005e SystemErr R at com.ibm.faces20.portlet.FacesPortlet.doRender(FacesPortlet.java:564)
[10/1/12 14:26:30:360 IST] 0000005e SystemErr R at com.ibm.faces20.portlet.FacesPortlet.doView(FacesPortlet.java:624)
[10/1/12 14:26:30:360 IST] 0000005e SystemErr R at com.ibm.faces20.portlet.FacesPortlet.doDispatch(FacesPortlet.java:496)
[10/1/12 14:26:30:360 IST] 0000005e SystemErr R at javax.portlet.GenericPortlet.render(GenericPortlet.java:222)
[10/1/12 14:26:30:360 IST] 0000005e SystemErr R at com.ibm.ws.portletcontainer.invoker.impl.PortletFilterChainImpl.doFilter(PortletFilterChainImpl.java:128)
Resolving the problem
To resolve the problem, add or replace the following context parameter in the web.xml file and republish the project.
<context-param>
<param-name>javax.faces.PARTIAL_STATE_SAVING</param-name>
<param-value>false</param-value>
</context-param>
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.