找不到Springframework webflow变量类名

时间:2012-08-01 08:35:02

标签: spring spring-webflow

我对spring webflow变量的初始化有问题。 我有两个流xml,它们看起来相同,但是当打开其中一个spring时抛出这个异常。在流中有两种变量初始化:

<var name="bean" bean="beanName" scope="flow"  />

<set attribute="id" value="${'someId'}" scope="flow" />

这是例外:

Caused by: java.lang.IllegalArgumentException: Name must not be null
at org.springframework.util.Assert.notNull(Assert.java:112)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:222)
at org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.toClass(FlowModelFlowBuilder.java:958)
at org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.parseFlowVariable(FlowModelFlowBuilder.java:389)
at org.springframework.webflow.engine.builder.model.FlowModelFlowBuilder.buildVariables(FlowModelFlowBuilder.java:172)
at org.springframework.webflow.engine.builder.FlowAssembler.directAssembly(FlowAssembler.java:103)
at org.springframework.webflow.engine.builder.FlowAssembler.assembleFlow(FlowAssembler.java:91)
at org.springframework.webflow.engine.builder.DefaultFlowHolder.assembleFlow(DefaultFlowHolder.java:109)
at org.springframework.webflow.engine.builder.DefaultFlowHolder.getFlowDefinition(DefaultFlowHolder.java:84)
at org.springframework.webflow.definition.registry.FlowDefinitionRegistryImpl.getFlowDefinition(FlowDefinitionRegistryImpl.java:61)
at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:138)
at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:193)
at com.exigen.base.ui.flow.DefaultFlowController.handleRequest(DefaultFlowController.java:56)
at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
... 82 more

2 个答案:

答案 0 :(得分:1)

我不确定您要做什么,但如果您想使用<var>元素,则需要名称和类属性。 喜欢     <var name="myVar" class="com.example.var.MyVar"/>

此外,您不需要在wefblow中定义bean,您可以自动使用applicationContext中定义的bean

答案 1 :(得分:0)

我解决了问题。问题出现在webflow方案版本不匹配中。我的一个流xml使用1.0,而系统使用2.0。