开发者

Cannot locate BeanDefinitionParser for element [executor]

开发者 https://www.devze.com 2022-12-25 10:49 出处:网络
I\'m trying to learn Spring MVC 2.0 and Spring Web Flow 1.0. I get following error (possibly when the dispatcher delegates a request to flow):

I'm trying to learn Spring MVC 2.0 and Spring Web Flow 1.0.

I get following error (possibly when the dispatcher delegates a request to flow):

Configuration problem: Cannot locate BeanD开发者_开发问答efinitionParser for element [executor]

I am using the Spring 2.0 and Web Flow 1.0 jar files in the application's build path.

Below is my Spring MVC 2.0 configuration file:

<bean name="/phonebook.htm" 
      class="org.springframework.webflow.executor.mvc.FlowController">
    <property name="flowExecutor" ref="flowExecutor"/> 
</bean> 
<!-- Resolves flow view names to .jsp templates --> 
<bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"> 
    <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp">
</bean>

And my Spring Web Flow 1.0 config:

<flow:executor id="flowExecutor" registry-ref="flowRegistry"/> 
<!-- Creates the registry of flow definitions for this application --> 
<flow:registry id="flowRegistry"> <flow:location path="/WEB-INF/flows/**-flow.xml"/>
</flow:registry> 


When eclipse deploy web application to tomcat it also deploy those jar files to lib directory which was not in build path.. so now when tomcat goes to execute.. it would probably find two jar files for web flow i.e. webflow 1.0 and webflow 2.0 And giving me the error.. i.e. when two different version jar files for webflow are in lib director.

i would also like to thank skaffman for his support..


OK, so it looks like the problem is with the <flow:executor> element in your webflow config. Spring is complaining that it doesn't understand what that means, and it's probably because you're missing the namespace declaration in the config file. This looks something like this:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:flow="http://www.springframework.org/schema/webflow-config"
       xsi:schemaLocation="
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
           http://www.springframework.org/schema/webflow-config
           http://www.springframework.org/schema/webflow-config/spring-webflow-config-1.0.xsd">

Your root element must look something like that. See documentation here.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号