首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Spring升级: Spring java.lang.AbstractMethodError: org.springframework.integration.config.xml.AbstractRouterParser.parseRouter

Spring升级: Spring java.lang.AbstractMethodError: org.springframework.integration.config.xml.AbstractRouterParser.parseRouter
EN

Stack Overflow用户
提问于 2021-09-09 10:37:00
回答 1查看 88关注 0票数 0

在Weblogic中部署我的应用程序时,我会收到以下错误。该功能在较早的Spring版本中运行良好。在将spring从2升级到4之后,我们得到了以下错误:

org.springframework.integration.config.xml.AbstractRouterParser.parseRouter(Lorg/w3c/dom/Element;Lorg/springframework/beans/factory/support/BeanDefinitionBuilder;Lorg/springframework/beans/factory/xml/ParserContext;)V:

java.lang.AbstractMethodError

以下是XML文件内容:

代码语言:javascript
复制
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/integration" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:beans="http://www.springframework.org/schema/beans" 
xmlns:ctx="http://www.springframework.org/schema/context"   
xmlns:int="http://www.springframework.org/schema/integration" 
xmlns:jms="http://www.springframework.org/schema/integration/jms"
xmlns:stream="http://www.springframework.org/schema/integration/stream" 
xmlns:si-xml="http://www.springframework.org/schema/integration/xml" 
xmlns:util="http://www.springframework.org/schema/util" 
xsi:schemaLocation="http://www.springframework.org/schema/beans 
  http://www.springframework.org/schema/beans/spring-beans-4.3.xsd 
  http://www.springframework.org/schema/context 
  http://www.springframework.org/schema/context/spring-context-4.3.xsd 
  http://www.springframework.org/schema/integration 
  http://www.springframework.org/schema/integration/spring-integration-4.3.xsd 
  http://www.springframework.org/schema/integration/jms
  http://www.springframework.org/schema/integration/jms/spring-integration-jms-4.3.xsd 
  http://www.springframework.org/schema/integration/stream 
  http://www.springframework.org/schema/integration/stream/spring-integration-stream-4.3.xsd 
  http://www.springframework.org/schema/integration/xml 
  http://www.springframework.org/schema/integration/xml/spring-integration-xml-4.3.xsd 
  http://www.springframework.org/schema/util 
  http://www.springframework.org/schema/util/spring-util.xsd">
  
<ctx:component-scan base-package="com.abc.xyz"/>    

<beans:bean id="resultToDocumentTransformer" class="org.springframework.integration.xml.transformer.ResultToDocumentTransformer"/>  
<beans:bean id="resultToStringTransformer"   class="org.springframework.integration.xml.transformer.ResultToStringTransformer"/>
<int:channel id="PBWCMAuditInputChannel"/>
<int:channel id="PBWCMInputJMSChannel"/>
<jms:message-driven-channel-adapter id="PBWCMInputJMSAdapter"
  destination="FMOB_IN" extract-payload="true" 
  connection-factory="connectionFactory" 
  channel="PBWCMAuditInputChannel" 
  error-channel="errorChannel"/>
<int:service-activator id="PBWCMMessageAuditor" 
input-channel="PBWCMAuditInputChannel" 
output-channel="PBWCMInputJMSChannel"
ref="mobileMessageAuditor"
method="auditRequest"/>
<si-xml:xpath-router id="wcmRequestRouter" input-channel="PBWCMInputJMSChannel">
 <si-xml:mapping value="WCM" channel="WCMChannel"/>
  </si-xml:xpath-router>
<si-xml:xpath-router id="WCMRequestRouter" input-channel="WCMChannel">
  <si-xml:xpath-expression expression="/faml/request/scrseqnumber"/>
  <si-xml:mapping value="01" channel="WCM01ValidateChannel"/>
</si-xml:xpath-router>
<int:channel id="WCM01ValidateChannel"/>
<si-xml:validating-filter id="WCM01Validator" 
input-channel="WCM01ValidateChannel" 
output-channel="WCM01InChannel"  
schema-location="classpath:xsd/request/WCM_01_Request.xsd" 
discard-channel="invalidMessageChannel"/>   
<int:channel id="WCM01InChannel"/>
<int:channel id="WCM01OutChannel"/>     
<si-xml:unmarshalling-transformer id="WCM01Unmarshaller" unmarshaller="WCM01ReqUnmarshaller"
  input-channel="WCM01InChannel"
  output-channel="WCM01OutChannel"/>    
<int:channel id="WCM01ResponseChannel" />   
<int:service-activator id="WCM01ServiceActivator" 
input-channel="WCM01OutChannel" 
output-channel="WCM01ResponseChannel" 
ref="WCMRequestProcessor"
method="processWCM01Request"/>  
<jms:outbound-channel-adapter id="WCM01ResponseOutAdapter" destination="responseQueue" channel="WCM01ResponseChannel"/> 
<beans:bean id="WCM01ReqUnmarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"> 
<beans:property name="contextPaths">
  <beans:list>
    <beans:value>com.abc.xyz.jms.jaxb.WCM_01_request</beans:value>
  </beans:list>
</beans:property>
</beans:bean>
</beans:beans>

lib文件夹中可用的JAR包括

代码语言:javascript
复制
org.springframework.integration-1.0.3.RELEASE.jar
org.springframework.integration.jms-1.0.3.RELEASE-1.0.3.RELEASE.jar
org.springframework.integration.stream-1.0.3.RELEASE-1.0.3.RELEASE.jar
spring-beans-4.3.20.RELEASE.jar
spring-context-4.3.18.RELEASE.jar
spring-integration-jms-4.3.17.RELEASE.jar
spring-integration-stream-4.3.17.RELEASE.jar
spring-integration-xml-4.3.17.RELEASE.jar

如果我从我的web.xml (contextConfigLocation)中删除这个XML,我的EAR就会成功地部署。

帮助我解决XML中的问题。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-09 13:27:53

所有Spring依赖项都必须在同一个版本中。在你的例子中,4.3.17.RELEASE。Spring框架依赖项也是如此。

注意:这两个版本都已经是EOL了。您需要考虑升级到最新的版本:https://spring.io/projects/spring-integration#learn

另外,请研究什么是依赖关系管理,以及如何避免额外的配置依赖于您使用的库传递的依赖项。

现在另一个有用的工具是Spring及其版本管理:https://spring.io/projects/spring-boot

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

https://stackoverflow.com/questions/69116707

复制
相关文章

相似问题

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