1

我正在尝试部署我的第一个 Spring webflow 应用程序。但是,我被困了 3 天,出现以下错误:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:找不到 XML 模式命名空间的 Spring NamespaceHandler [http://www.springframework.org/schema/webflow]

我已经阅读了许多文章和论坛,但找不到任何解决方案。

以下是我在 pom.xml 中添加的依赖项:

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>${spring.version}</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-xml</artifactId>
        <version>2.1.3.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-webflow</artifactId>
        <version>2.3.2.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.webflow</groupId>
        <artifactId>spring-binding</artifactId>
        <version>2.3.2.RELEASE</version>
    </dependency>

下面是类路径文件,显示了我的类路径中的 jar 文件

<classpath>
  <classpathentry kind="src" path="src/test/java" output="target/test-classes" including="**/*.java"/>
  <classpathentry kind="src" path="src/test/resources" output="target/test-classes" excluding="**/*.java"/>
  <classpathentry kind="src" path="src/main/java" including="**/*.java"/>
  <classpathentry kind="src" path="src/main/resources" excluding="**/*.java"/>
  <classpathentry kind="output" path="target/classes"/>
  <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-core/3.2.2.RELEASE/spring-core-3.2.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-context/3.2.2.RELEASE/spring-context-3.2.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-aop/3.2.2.RELEASE/spring-aop-3.2.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-beans/3.2.2.RELEASE/spring-beans-3.2.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-expression/3.2.2.RELEASE/spring-expression-3.2.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/webflow/spring-webflow/2.3.2.RELEASE/spring-webflow-2.3.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-web/3.2.1.RELEASE/spring-web-3.2.1.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/spring-webmvc/3.2.1.RELEASE/spring-webmvc-3.2.1.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/webflow/spring-binding/2.3.2.RELEASE/spring-binding-2.3.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/webflow/spring-js/2.3.2.RELEASE/spring-js-2.3.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/org/springframework/webflow/spring-js-resources/2.3.2.RELEASE/spring-js-resources-2.3.2.RELEASE.jar"/>
  <classpathentry kind="var" path="M2_REPO/jstl/jstl/1.2/jstl-1.2.jar"/>
  <classpathentry kind="var" path="M2_REPO/taglibs/standard/1.1.2/standard-1.1.2.jar"/>
</classpath>

请帮忙。

4

2 回答 2

1

我已经解决了这个问题。我指的是 mvc 配置文件中的 flow xml 而不是 webflow 配置。

于 2013-10-24T06:12:12.650 回答
0

我有这个问题。对我来说,问题出在链接到流定义文件的 web.xml 中,如下所示(这是不正确的):

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/dispatcher-servlet.xml
        /WEB-INF/myFlow.xml
    </param-value>
</context-param>

应该是这样的(这是正确的):

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        /WEB-INF/dispatcher-servlet.xml
    </param-value>
</context-param>

我希望这对某人有所帮助,我已经倒了 4 个小时。

于 2015-11-18T16:58:37.170 回答