首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >mule-模块- spring -config和spring版本不匹配

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

Stack Overflow用户
提问于 2022-08-09 07:54:57
回答 1查看 116关注 0票数 0

我正在犯错误:

代码语言:javascript
代码运行次数:0
运行
复制
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)

使用module spring 3.9.2.jar和spring版本5.3.22。

,但当我们使用Spring版本时,代码相同,为4.3.18。version .

SpringBeanTest.xml:

代码语言:javascript
代码运行次数:0
运行
复制
<?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

代码语言:javascript
代码运行次数:0
运行
复制
<?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>

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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-08-09 11:49:15

Mule3.x不允许使用与其发行版中包含的版本不同的Spring版本。Mule 3.9.2包括,例如,包含Spring4.1.9。使用与Mule版本中包含的Spring不同的版本可能会导致您正在经历的意外错误,-as是不受支持的。最终的Mule 3.x版本Mule 3.9.5支持Spring4.3.29。

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

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73288305

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档