In order for an ADF application to support High Availability in clustered environment with server fail over. The below steps must be followed in developing an ADF application.
1. All Manage Beans must implement Serializable.
2. UI component bindings must be declared in a bean with shorter scope (backing bean scope or request scope).
3. If it needs to be declared in Manage Bean with PageFlowScope (Not recommended), please ensure you declare the binding as transient.
4. Any objects that are declared as an attribute in Manage Bean must be Serialized.
5.ADF component bindings can not support the Serializable.To make them support HA use the following code for component binding,getters and setters in pageFlowScope bean.
ex. Normal ADF code for binding,getters and setters will be as follows
Private RichSelectOneChoice partySelect
public void setPartySelect(RichSelectOneChoice partySelect) {
this.partySelect = partySelect;
}
public RichSelectOneChoice getPartySelect() {
return partySelect;
}
Change this to following code in your pageFlowScope bean to support HA.
import org.apache.myfaces.trinidad.util.ComponentReference;
Private ComponentReference partySelect;
public void setPartySelect(RichSelectOneChoice partySelect) {
this.partySelect =ComponentReference.newUIComponentReference(partySelect);
}
public RichSelectOneChoice getPartySelect() {
if(partySelect !=null){
return (RichSelectOneChoice)partySelect.getComponent();
}
return null;
}
The following files must be modified to make an ADF application High Available in clustered environment.
1. All Manage Beans must implement Serializable.
2. UI component bindings must be declared in a bean with shorter scope (backing bean scope or request scope).
3. If it needs to be declared in Manage Bean with PageFlowScope (Not recommended), please ensure you declare the binding as transient.
4. Any objects that are declared as an attribute in Manage Bean must be Serialized.
5.ADF component bindings can not support the Serializable.To make them support HA use the following code for component binding,getters and setters in pageFlowScope bean.
ex. Normal ADF code for binding,getters and setters will be as follows
Private RichSelectOneChoice partySelect
public void setPartySelect(RichSelectOneChoice partySelect) {
this.partySelect = partySelect;
}
public RichSelectOneChoice getPartySelect() {
return partySelect;
}
Change this to following code in your pageFlowScope bean to support HA.
import org.apache.myfaces.trinidad.util.ComponentReference;
Private ComponentReference partySelect;
public void setPartySelect(RichSelectOneChoice partySelect) {
this.partySelect =ComponentReference.newUIComponentReference(partySelect);
}
public RichSelectOneChoice getPartySelect() {
if(partySelect !=null){
return (RichSelectOneChoice)partySelect.getComponent();
}
return null;
}
The following files must be modified to make an ADF application High Available in clustered environment.
<adf-scope-ha-support>true</ adf-scope-ha-support>
</adf-controller-config>
</adf-controller-config>
weblogic.xml
<session-descriptor>
<session-descriptor>
<persistent-store-type> replicated_if_clustered</ persistent-store-type>
</session-descriptor>
For testing, please add the below parameter in your weblogic domain
setDomainEnv.cmd
-Dorg.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION=all
Comments
Post a Comment