Sep 12, 2011

ADF-UI : ADFc: Scope object serialization failed

If you have ADF applications running on clustered environment, you might be familliar with the Serialization errors in the server log messages. The error is somthing like this.





There are a few reasons for this error to appear in the logs.
  1. The managed bean class is not implementing Serializable and the bean is in scope greater than viewScope.
  2. The other reason could be that you have UI Component bindings in the serialized bean with scope greater than viewScope.
You can read more about ADF High Availability at Oracle ADF and High Availability Concepts.


To avoid these error messages, you need to keep following things in mind while developing managed beans.
  1. Do not bind UI Components in managed beans with scope more than viewScope.
  2. If you have to use UI Component bindings then use backing bean to bind the UI Components and reference the pageFlowScope bean inside backing bean to process the important data.
Also by default the JDeveloper will not display these messages on the integrated server. To enable these message on the integrated server, run the server with following JVM parameter


-Dorg.apache.myfaces.trinidad.CHECK_STATE_SERIALIZATION=all


2 comments:

Frank Nimphius said...

"Do not bind UI Components in managed beans with scope more than viewScope."

In general, component bindings should live no longer than request length (which means request scope or backingBean scope). For whatever you need to keep for longer, write it in a separate bean and look that bean up from the shorter scope'd bean.

Unknown said...

Hi Frank,

Thanks for the valuable comment.

Tanvir