【问题标题】:Spring Upgrade: Spring Integration JMS java.lang.AbstractMethodError: org.springframework.integration.config.xml.AbstractRouterParser.parseRouterSpring升级:Spring集成JMS java.lang.AbstractMethodError:org.springframework.integration.config.xml.AbstractRouterParser.parseRouter
【发布时间】:2021-11-06 00:46:54
【问题描述】:

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

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

以下是 XML 文件内容:

<?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 是

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 中的问题。

【问题讨论】:

    标签: spring spring-integration spring-jms


    【解决方案1】:

    所有 Spring Integration 依赖项必须在同一版本中。在你的情况下4.3.17.RELEASE。这同样适用于 Spring Framework 依赖项。

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

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-23
      • 2013-01-06
      • 1970-01-01
      • 2015-11-01
      • 2013-02-04
      • 1970-01-01
      • 2015-05-19
      相关资源
      最近更新 更多