I recently had the pleasure of deploying an Oracle BPM application to a brand new staging environment configured for high availability. The application appeared to run smoothly but for an occasional exception. This stack trace seen in the logs is probably a familiar sight for many:
&lt;ADFc-62004&gt; &lt;ADFc:Scope object serialization failed (object not serializable), scope='pageflowscope[null]' objectType='com.TestBean' java.io.NotSerializableException: com.TestBean
The Oracle documentation has a high availability guide that sheds some light in this matter. As a quick guide, verify:
- All pageflowscope and viewscope managed beans must implement Serializable.
- All pageflowscope and viewscope managed beans *should not* contain UI bindings. This is explained very clearly in Frank’s blog. In essence, component bindings should live for a http request (request scope or backingBean scope). Any state or data you need for a longer duration can be saved in a pageflowscope bean separately.
When a value within a managed bean in either view scope or page flow scope is modified, the application needs to notify Oracle ADF so that it can ensure the bean’s new value is replicated.
Map&lt;String, Object&gt; viewScope = AdfFacesContext.getCurrentInstance().getViewScope(); MyObject obj = (MyObject)viewScope.get(&quot;myObjectName&quot;); Obj.setFoo(&quot;newValue&quot;);
Without additional code, Oracle ADF will be unaware of this change and will not know that a new value needs to be replicated within the cluster. To inform Oracle ADF that an object in an ADF scope has been modified and that replication is needed, use the markScopeDirty() method. The markScopeDirty() method accepts only viewScope and pageFlowScope as parameters.
controllerContext ctx = ControllerContext.getInstance(); ctx.markScopeDirty(viewScope);
Jdeveloper integrated server will not spit these errors by default. The server has to be run with the following JVM parameter:
Note that this check is disabled by default to reduce runtime overhead. Do not use this after your testing is complete.
Some additional configuration to vertify:
1. adf-config.xml updates for high availability:
&lt;adf-controller-config xmlns=&quot;http://xmlns.oracle.com/adf/controller/config&quot;&gt; &lt;adf-scope-ha-support&gt;true&lt;/adf-scope-ha-support&gt; &lt;/adf-controller-config&gt;
2. HTTP session state replication setting in weblogic.xml is setup
&lt;weblogic-web-app&gt; &lt;session-descriptor&gt; &lt;persistent-store-type&gt; replicated_if_clustered &lt;/persistent-store-type&gt; &lt;/session-descriptor&gt; &lt;/weblogic-web-app&gt;
3. Oracle ADF is not configured by default for failover by default. Failover is supported only with the proper setting in the ADF Business Components configuration file (bc4j.xml):
&lt;AppModuleConfig ... &lt;AM-Pooling jbo.dofailover=&quot;true&quot;/&gt; &lt;/AppModuleConfig&gt;