Pivotal Knowledge Base

Follow

Unable to Load Class 'x.y.Customer' at [] FlowModelFlowBuilder.toClass(FlowModelFlowBuilder.java:965)

Environment

 Product  Version
 Spring Web Flow  All

Symptom

You receive the following error:

[Preliminary] Unable to load class 'x.y.Customer'
at [] FlowModelFlowBuilder.toClass(FlowModelFlowBuilder.java:965) (2016822_draft)

Cause

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)

Resolution

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.

Additional Information

The example attached below demonstrates the suggested solution. To run the example, Apache Maven is needed: MVN tomcat:run

  • webflow_example.zip

Comments

Powered by Zendesk