Friday, June 6, 2014

How to avoid java.io.NotSerializableException in Oracle ADF?

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.
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

No comments:

Post a Comment