mule模块spring-config和spring-bean版本不匹配



我收到错误:

Caused by: org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 5 in XML document from URL [jar:file:/<File path>/.m2/repository/org/mule/modules/mule-module-spring-config/3.9.2/mule-module-spring-config-
3.9.2.jar!/registry-bootstrap-mule-config.xml] is invalid; nested exception is org.xml.sax.SAXParseException; lineNumber: 5; columnNumber: 122; cvc-elt.1.a: Cannot find the declaration of element 'beans'.
at <TestclassPath>.<init>(<ClassName>.java:32)

同时使用多模块spring-config-3.9.2.jar和spring-bean版本5.3.22。

但当我们使用Springbean版本4.3.18.RELEASE时,同样的代码也会通过。

SpringBeanTest.xml:

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

</beans>

MuleTest.xml

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:file="http://www.mulesoft.org/schema/mule/file" 
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ajax="http://www.mulesoft.org/schema/mule/ajax"
xmlns:json="http://www.mulesoft.org/schema/mule/json"
xmlns:jdbc="http://www.mulesoft.org/schema/mule/ee/jdbc"
xmlns:spring="http://www.springframework.org/schema/beans"
xmlns:core="http://www.mulesoft.org/schema/mule/core" version="CE-3.3.1" 
xmlns:jms="http://www.mulesoft.org/schema/mule/jms"  
xmlns:vm="http://www.mulesoft.org/schema/mule/vm"    
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:email="http://www.mulesoft.org/schema/mule/email"
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting"
xmlns:smtp="http://www.mulesoft.org/schema/mule/smtp"
xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq"      
xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/3.3/mule-json.xsd
http://www.mulesoft.org/schema/mule/ajax http://www.mulesoft.org/schema/mule/ajax/3.3/mule-ajax.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/ee/jdbc http://www.mulesoft.org/schema/mule/ee/jdbc/3.3/mule-jdbc-ee.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.3/mule-jms.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.3/mule-vm.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd 
http://www.mulesoft.org/schema/mule/cxf http://www.mulesoft.org/schema/mule/cxf/3.3/mule-cxf.xsd
http://www.mulesoft.org/schema/mule/email http://www.mulesoft.org/schema/mule/email/3.3/mule-email.xsd
http://www.mulesoft.org/schema/mule/smtp http://www.mulesoft.org/schema/mule/smtp/current/mule-smtp.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd"> 


<spring:beans> 
<spring:import resource="classpath:SpringBeanTest.xml"/>
</spring:beans>

...
</mule>

我刚到春天,谁能帮我解决这个问题吗。

Mule 3.x不允许使用与其发行版中包含的版本不同的Spring Framework版本。Mule 3.9.2包括例如Spring 4.1.9。使用与Mule版本不同的Spring版本可能会导致意外错误,这是不受支持的。Mule 3.9.5是Mule 3.x的最终版本,支持Spring 4.3.29。

特别是Spring 5不受任何版本的Mule 3.x的支持。请参阅https://help.mulesoft.com/s/article/Spring-versions-throughout-each-version-of-Mule有关Mule 3.9.2之前支持的Spring版本的更多信息。

Mule 4将运行时使用的Spring版本与应用程序通过Spring模块使用的版本隔离开来,但它与Mule 3应用程序不兼容。

相关内容

  • 没有找到相关文章

最新更新