[英]Spring Integration 4.1.0 Migration problems
I'm having problems migrating my application form spring-integration 4.0.4 to the recent 4.1.0 release. 我在将应用程序从spring-integration 4.0.4迁移到最新的4.1.0版本时遇到问题。
Once replacing the jars, my integration context throws an exception for each <recipient-list-router/>
tag. 一旦更换了罐子,我的集成上下文就会为每个
<recipient-list-router/>
标记引发一个异常。
The thrown exception is a java.lang.ClassCastException
the message is: 抛出的异常是
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
I am using Spring-Integration 4.1.0.RELEASE, spring-core 4.1.2.RELEASE, and running on jdk1.8.0_05. 我正在使用Spring-Integration 4.1.0.RELEASE,spring-core 4.1.2.RELEASE,并在jdk1.8.0_05上运行。 My Integration beans context contains two
<recipient-list-router/>
tags, which upon removal, do not throw this error. 我的Integration Bean上下文包含两个
<recipient-list-router/>
标记,这些标记在删除后不会引发此错误。
The code from AbstractSimpleMessageHandlerFactoryBean
says: 来自
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.");
}
}
So, let's switch of debug
for the org.springframework.integration
category! 因此,让我们将
debug
切换为org.springframework.integration
类别!
From other side I agree that it is a bug, because if our messageHandler
is a Proxy
we can't simply cast it to the IntegrationObjectSupport
. 从另一面来看,我同意这是一个错误,因为如果我们的
messageHandler
是Proxy
我们不能简单地将其messageHandler
转换为IntegrationObjectSupport
。
So, feel free to raise a JIRA ticket on the matter. 因此,随时可以为此事举起JIRA门票。
From other side it isn't clear why removal of <recipient-list-router/>
evict an issue... 从另一面来看,不清楚为什么删除
<recipient-list-router/>
引起问题……
Because <recipient-list-router/>
doesn't support <request-handler-advice-chain>
. 因为
<recipient-list-router/>
不支持<request-handler-advice-chain>
。
I agree that we have introduced in the 4.1 the RecipientListRouterManagement
and if you use JMX the special MBean will be registered for the RecipientListRouter
and the last one becomes Proxy
, but it isn't clrear how that proxying relates to the request-handler-advice-chain
log message... 我同意我们在4.1中引入了
RecipientListRouterManagement
,如果您使用JMX,则将为RecipientListRouter
注册特殊的MBean,最后一个将成为Proxy
,但是代理与request-handler-advice-chain
如何并不request-handler-advice-chain
日志消息...
Would be great if you can debug for that line from AbstractSimpleMessageHandlerFactoryBean
and show us the real object for that Proxy
. 如果您可以从
AbstractSimpleMessageHandlerFactoryBean
为该行调试并向我们显示该Proxy
的真实对象,那就太好了。
And show, please, more StackTrace . 并显示更多StackTrace。 Maybe we can see more context to figure out the root of cause.
也许我们可以看到更多背景来找出原因的根源。
Thank you! 谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.