[英]Spring Integration 4.1.0 Migration problems
我在将应用程序从spring-integration 4.0.4迁移到最新的4.1.0版本时遇到问题。
一旦更换了罐子,我的集成上下文就会为每个<recipient-list-router/>
标记引发一个异常。
抛出的异常是java.lang.ClassCastException
,消息为:
Caused by: java.lang.ClassCastException: com.sun.proxy.$Proxy62 cannot be cast to org.springframework.integration.context.IntegrationObjectSupport
at org.springframework.config.AbstractSimpleMessageHandlerFactoryBean.createHandlerInternal(AbstractSimpleMessageHandlerFactoryBean.java:130)
at org.springframework.integration.config.AbstractSimpleMessageHandlerFactoryBean.getObject(AbstractSimpleMessageHandlerFactoryBean.java:102)
at org.springframework.integration.config.AbstractSimpleMessageHandlerFactoryBean.getObject(AbstractSimpleMessageHandlerFactoryBean.java:44)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanReagistrySupport.java:168)
... 20 more
我正在使用Spring-Integration 4.1.0.RELEASE,spring-core 4.1.2.RELEASE,并在jdk1.8.0_05上运行。 我的Integration Bean上下文包含两个<recipient-list-router/>
标记,这些标记在删除后不会引发此错误。
来自AbstractSimpleMessageHandlerFactoryBean
的代码说:
else if(!(this.handler instanceof AbstractReplyProducingMessageHandler)) {
if (logger.isDebugEnabled()) {
logger.debug("adviceChain can only be set to AbstractReplyProducingMessageHandler or its subclass, "
+ ((IntegrationObjectSupport) this.handler).getComponentName() + " doesn't support it.");
}
}
因此,让我们将debug
切换为org.springframework.integration
类别!
从另一面来看,我同意这是一个错误,因为如果我们的messageHandler
是Proxy
我们不能简单地将其messageHandler
转换为IntegrationObjectSupport
。
因此,随时可以为此事举起JIRA门票。
从另一面来看,不清楚为什么删除<recipient-list-router/>
引起问题……
因为<recipient-list-router/>
不支持<request-handler-advice-chain>
。
我同意我们在4.1中引入了RecipientListRouterManagement
,如果您使用JMX,则将为RecipientListRouter
注册特殊的MBean,最后一个将成为Proxy
,但是代理与request-handler-advice-chain
如何并不request-handler-advice-chain
日志消息...
如果您可以从AbstractSimpleMessageHandlerFactoryBean
为该行调试并向我们显示该Proxy
的真实对象,那就太好了。
并显示更多StackTrace。 也许我们可以看到更多背景来找出原因的根源。
谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.