Scope object serialization failed (object not serializable)
By Frank Nimphius-Oracle on May 04, 2012
A common reason for the "SEVERE: ADFc: Scope object serialization failed (object not serializable)" error message is that application developers reference JSF components in managed beans with a scope larger than request. When using the JSF component Binding property to point to a managed bean, think backing bean and thus don't reference beans that are in scopes larger than request scope (don't: viewScope, pageFlowSope, sessionScope, applicationScope).
If, from a managed bean in a scope larger than request you need to have access to a component instance (though the other way around is a more common use case) then either
- look up the component on the UIViewRoot. The
Trinidad util class ComponentUtils is a appears to be useful for this too:
- resolve an EL reference to a managed bean in request scope that holds the component binding
As mentioned, a more common use case is to access a bean in a scope larger than request from a backing bean. A use case for this is if you need to remember a specific state, like a list of selected values in a select many list, or the disclosure state of panel tabs.
In this case you would save the state information in a bean with a lifecycle that spans beyond request scope and access it from a request scope backing bean using a managed property or by resolving EL in Java.