|Spring Web Flow||All|
You receive the following error:
[Preliminary] Unable to load class 'x.y.Customer' at  FlowModelFlowBuilder.toClass(FlowModelFlowBuilder.java:965) (2016822_draft)
The error arises when integrating a model value into the Web Flow. When adding a customer object to the Web Flow as a form backing object (model object), and adding the VAR element to the flow definition, the following exception is thrown:
java.lang.IllegalArgumentException: Unable to load class ' domain.Customer' at org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.toClass(FlowModelFlowBuilder.java:965)
To address this exception, make sure the form backing object is serializable and that this model object is in an accessible scope, such as flowScope or viewScope. The attached example application demonstrates the suggested solution.
The example attached below demonstrates the suggested solution. To run the example, Apache Maven is needed: MVN tomcat:run