2

I'm trying to integrate SWF in Spring mvc application for the first time, but I'm getting this error :

org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException in XML document from ServletContext resource [/WEB-INF/mvc-dispatcher-servlet.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: XX; columnNumber: XX; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'webflow:flow-builder-services'

this is my mvc-dispatcher-servlet.xml file (referenced by contextConfigLocation in web.xml)

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

<bean name="/welcome.htm" class="com.test.app.controller.MainController" />


<bean id="viewResolver"
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <property name="prefix">
        <value>/WEB-INF/pages/</value>
    </property>
    <property name="suffix">
        <value>.jsp</value>
    </property>
</bean>


<!-- ================================================================== -->
<!-- Spring Web Flow stuff -->
<!-- ================================================================== -->

<bean id="viewFactoryCreator"
    class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
    <property name="viewResolvers" ref="viewResolver" />
</bean>

<webflow:flow-builder-services id="flowBuilderServices"/>


<webflow:flow-registry id="flowRegistry"
    flow-builder-services="flowBuilderServices">
    <webflow:flow-location path="/WEB-INF/flows/helloworldflow.xml" />
</webflow:flow-registry>



<webflow:flow-executor id="flowExecutor"
    flow-registry="flowRegistry">
</webflow:flow-executor>


<!-- Enables FlowHandler URL mapping -->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
    <property name="flowExecutor" ref="flowExecutor" />
</bean>

<!-- Maps request paths to flows in the flowRegistry; e.g. a path of /hotels/booking 
    looks for a flow with id "hotels/booking" -->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
    <property name="flowRegistry" ref="flowRegistry" />
    <property name="order" value="0" />
</bean>

I'm using spring 3.0.3.RELEASE and spring webflow 2.1.1.RELEASE

Do you have an explanation about this issue ?

Thanks in advance

javaxiss
  • 680
  • 3
  • 13
  • 34
  • 2
    According to this post http://stackoverflow.com/questions/6058037/the-matching-wildcard-is-strict-but-no-declaration-can-be-found-for-element-tx it can be version mismatch, for axample you declare http://www.springframework.org/schema/beans/spring-beans-2.5.xsd but use spring 3.0.3.RELEASE. – erhun Jan 20 '14 at 15:21

2 Answers2

2

Change your spring beans schema version. You're using 2.5, but it should be 3.0.

Software Engineer
  • 15,457
  • 7
  • 74
  • 102
0

You are right guys !

It was a version mismatch. I also changed my spring webflow schema version to http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd as I'm using SWF 2.1.1.RELEASE

PS: It's also important to verify spring jars downloaded by maven, and compare their versions to the ones declared in schema location. (If spring-webflow 2.1.1 is used, the schema location must declare spring-webflow-config-2.0 not spring-webflow-config-2.3, same thing for the other spring jars/schema declarations)

javaxiss
  • 680
  • 3
  • 13
  • 34