Validations in JSF 2.0 portlets do not work with partial state saving turned on

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:

(0 users)Average rating

Document information


More support for:

Rational Application Developer for WebSphere Software
Portal / Portlet Development

Software version:

8.5

Operating system(s):

Windows

Reference #:

1611984

Modified date:

2012-10-10

Translate my page

Machine Translation

Content navigation