IBM Support

Deploying JavaServer Faces applications to a clustered environment

Troubleshooting


Problem

Unexpected behavior occurs when running JavaServer Faces (JSF) applications or JSF Portlet applications developed in WebSphere Studio Application Developer and Rational Application Developer for WebSphere Software and deployed to a clustered WebSphere Application Server or clustered WebSphere Portal Server.

Cause

JSF applications or JSF portlets developed in WebSphere Studio Application Developer v5.x, Rational Application Developer v6.0.x and v7.0.x and targeting WebSphere Application Server v5.0.x, v5.1.x or WebSphere Portal Server v5.0.x, v5.1.x has a limitation with the default JSF implementation preventing the application from being able to function in a clustered environment. In order to support a clustered configuration, objects stored in session must be serializable. A JSF application state chosen to be stored in session is, by default, not serializable.

Resolving The Problem

Refer to the tables below for the version of your product.

Rational Application Developer v7.0.x

JSF Web Application
WebSphere Application Server v6.1.x



Use the context parameter com.sun.faces.enableHighAvailability with the JSF implementation provided with WAS to support a clustered configuration.
WebSphere Application Server v6.0.xUse the context parameter com.sun.faces.enableHighAvailability with the JSF implementation provided with WAS to support a clustered configuration.
WebSphere Application Server v5.1.xA possible solution is to use the JSF option of saving state in the client as a hidden input field.

JSF Portlet Application
WebSphere Portal Server v6.0.x on WAS v6.0.x

Use the context parameter com.sun.faces.enableHighAvailability with the JSF implementation provided with WAS to support a clustered configuration.
WebSphere Portal Server v5.1.x on WAS v6.0.xUse the context parameter com.sun.faces.enableHighAvailability with the JSF implementation provided with WAS to support a clustered configuration.
WebSphere Portal Server v5.1.x on WAS v5.1.xA possible solution is to use the JSF option of saving state in the client as a hidden input field.

Rational Application Developer v6.0.x

JSF Web Application





WebSphere Application Server v6.0.xUse the context parameter com.sun.faces.enableHighAvailability with the JSF implementation provided with WebSphere Application Server to support a clustered configuration.
WebSphere Application Server v5.1.xA possible solution is to use the JSF option of saving state in the client as a hidden input field.
WebSphere Application Server v5.0.xA possible solution is to use the JSF option of saving state in the client as a hidden input field.

JSF Portlet Application
WebSphere Portal Server v5.1.x on WebSphere Application Server v6.0.xUse the context parameter com.sun.faces.enableHighAvailability with the JSF implementation provided with WAS to support a clustered configuration.
WebSphere Portal Server v5.1.x on WebSphere Application Server v5.1.xNo solution available.
WebSphere Portal Server v5.0.xNo solution available.

WebSphere Studio Application Developer v5.1.2

JSF Web Application
WebSphere Application Server v5.1.xA possible solution is to use the JSF option of saving state in the client as a hidden input field.


Using the context parameter com.sun.faces.enableHighAvailability
To use this context parameter in WebSphere Application Server v6.0.x, you must be at v6.0.2.23 or above as this version includes the APARs PK43575 and PK23253 (links below) which implements this context parameter and serializes the JSF classes to allow for a clustered configuration. For WebSphere Application Server v6.1.x use the JSF implementation provided with WebSphere Application Server as this version implements the context parameter com.sun.faces.enableHighAvailability by default.

If your application was developed targeting a WebSphere Application Server v5.1.x server (or Portal v5.1.x on WebSphere Application Server v5.1.x) and is planning to deploy to a WebSphere Application Server v6.0.x server (or Portal v5.1.x on WebSphere Application Server v6.0.x) in addition to using the context parameter you will need to remove the default JSF implementation that is included with the WAR file from the WebContent\WEB-INF\lib directory (jsf-impl.jar, jsf-api.jar) so that it can make use of the JSF implementation provided with WebSphere Application Server.

To take advantage of this context parameter go to the project's web deployment descriptor, variables tab and under the Context Parameters section add the parameter name: com.sun.faces.enableHighAvailability and parameter value:true.

Using the context parameter javax.faces.STATE_SAVING_METHOD
Since the default implementation does not serialize the state in the session an alternative solution is to use the JSF option of saving state in the client as a hidden input field. This is done by setting the context-parameter: javax.faces.STATE_SAVING_METHOD to client.

[{"Product":{"code":"SSRTLW","label":"Rational Application Developer for WebSphere Software"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Web Development","Platform":[{"code":"PF033","label":"Windows"},{"code":"PF016","label":"Linux"}],"Version":"6.0;6.0.0.1;6.0.1;6.0.1.1;6.0.1.2;7.0;7.0.0.1;7.0.0.2;7.0.0.3;7.0.0.4;7.0.0.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSYK2S","label":"Rational Software Architect Designer"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Web Development","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"6.0;6.0.0.1;6.0.1;6.0.1.1;6.0.1.2;7.0;7.0.0.1;7.0.0.2;7.0.0.3;7.0.0.4;7.0.0.5","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSBRLP","label":"WebSphere Studio Application Developer"},"Business Unit":{"code":"BU050","label":"BU NOT IDENTIFIED"},"Component":"Web Development and design","Platform":[{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
10 September 2020

UID

swg21254490