找不到Spring webflow架构xsd

时间:2017-11-21 14:21:47

标签: java spring spring-webflow

我是Spring web-flow的新手。请在我的流程定义文件下面找到:

<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/webflow
      http://www.springframework.org/schema/webflow/spring-webflow-2.4.xsd">


    <view-state id="welcome" view="/welcome.jsp">
       <transition on="continue" to="finish" />
       <transition on="cancel" to="cancelled" />
    </view-state>

    <end-state id="cancelled" view="/cancelled.jsp" />
    <end-state id="finish" view="/finish.jsp" />
 </flow>

我的Spring配置文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:webflow-config="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="http://www.springframework.org/schema/webflow-config 
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.4.xsd
      http://www.springframework.org/schema/mvc 
      http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
      http://www.springframework.org/schema/beans 
      http://www.springframework.org/schema/beans/spring-beans.xsd
      http://www.springframework.org/schema/context 
      http://www.springframework.org/schema/context/spring-context-4.3.xsd">

       <mvc:annotation-driven/>

      <context:component-scan base-package="com.order"/>
      <bean id="viewResolver"       class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="prefix" value="/WEB-INF/view/" />
            <property name="suffix" value=".jsp" />
        </bean>

    <!--  Webflow Configuration -->
       <webflow-config:flow-executor id="flowExecutor"/>

       <webflow-config:flow-registry id="flowRegistry">
           <webflow-config:flow-location-pattern value="/WEB-INF/spring/webFlowConfig/*-flow.xml"/>
       </webflow-config:flow-registry>

    <bean id="flowMappings" class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
        <property name="order" value="0"/>
        <property name="flowRegistry" ref="flowRegistry"/>
    </bean>

     <bean 
     class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
        <property name="flowExecutor" ref="flowExecutor"/>
     </bean>

      <import resource="../webFlowConfig/orderweb-flow.xml"/>
 </beans>

我正在使用weblogic 12.1.3进行部署。我在部署期间遇到以下错误:

     org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 72; 
     schema_reference.4: Failed to read schema document 
     'http://www.springframework.org/schema/webflow/spring-webflow-2.4.xsd', 
      because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
       at    com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:99)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:392)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:306)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:4160)
Truncated. see log file for complete stacktrace
Caused By: java.net.ConnectException: Tried all: '5' addresses, but could 
not connect over HTTP to server: 'www.springframework.org', port: '80'
   at weblogic.net.http.HttpClient.openServer(HttpClient.java:401)
   at weblogic.net.http.HttpClient.openServer(HttpClient.java:506)
   at weblogic.net.http.HttpClient.New(HttpClient.java:313)
   at weblogic.net.http.HttpClient.New(HttpClient.java:292)
   at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:267)
   Truncated. see log file for complete stacktrace

我有所有相关的jar文件。我还添加了所需的配置 web.xml文件。 任何人都可以有任何合适的解决方案???

2 个答案:

答案 0 :(得分:0)

  • 首先,在指定版本号时不使用版本号是一种常见做法。原因here。您可以尝试删除版本号。
  • 另一种可能性,也是由于防火墙的限制而发生的。

答案 1 :(得分:0)

我删除了<import resource="../webFlowConfig/orderweb-flow.xml"/> applicationConfig.xml。我在Spring Bean Coniguration文件和Spring Web流程定义文件之间混合。