spring集成rmi客户端don';重新启动服务器(部署在weblogic中)时无法获取新存根

spring集成rmi客户端don';重新启动服务器(部署在weblogic中)时无法获取新存根,weblogic,rmi,spring-integration,Weblogic,Rmi,Spring Integration,我有一个关于spring integration rmi的问题。我有一个使用spring integration的rmi服务器和rmi客户端。当我在tomcat中部署它们或在weblogic中部署服务器或在tomcat中部署客户端时,效果很好。但当我将它们都放在weblogic中时,效果不太好。当服务器和客户端按顺序启动时,它可以工作,但当服务器重新启动时,客户端将不会获得新的存根与服务器通信。但是使用tomcat,客户端将在异常时获得新的存根。为什么 <rmi:inbound-gatew

我有一个关于spring integration rmi的问题。我有一个使用spring integration的rmi服务器和rmi客户端。当我在tomcat中部署它们或在weblogic中部署服务器或在tomcat中部署客户端时,效果很好。但当我将它们都放在weblogic中时,效果不太好。当服务器和客户端按顺序启动时,它可以工作,但当服务器重新启动时,客户端将不会获得新的存根与服务器通信。但是使用tomcat,客户端将在异常时获得新的存根。为什么

<rmi:inbound-gateway request-channel="rmiRequestChannel"
                     registry-port="11099"
                     auto-startup="true"
                     request-timeout="5000"
                     reply-channel="rmiResponseChannel"
                     reply-timeout="5000" />

<int:chain input-channel="rmiRequestChannel" output-channel="rmiResponseChannel">
    <int:service-activator ref="hellowIntegrationRmi" method="hello"/>
</int:chain>
spring集成配置如下: 服务器:

<rmi:inbound-gateway request-channel="rmiRequestChannel"
                     registry-port="11099"
                     auto-startup="true"
                     request-timeout="5000"
                     reply-channel="rmiResponseChannel"
                     reply-timeout="5000" />

<int:chain input-channel="rmiRequestChannel" output-channel="rmiResponseChannel">
    <int:service-activator ref="hellowIntegrationRmi" method="hello"/>
</int:chain>

实际上
RmiOutboundGateway
设置
proxyFactory.setRefreshStubonConnectionFailure(true)因此,
RmiClientInterceptor
执行
刷新和重试
,但实际上只执行一次

<rmi:inbound-gateway request-channel="rmiRequestChannel"
                     registry-port="11099"
                     auto-startup="true"
                     request-timeout="5000"
                     reply-channel="rmiResponseChannel"
                     reply-timeout="5000" />

<int:chain input-channel="rmiRequestChannel" output-channel="rmiResponseChannel">
    <int:service-activator ref="hellowIntegrationRmi" method="hello"/>
</int:chain>
我建议您使用
RequestHandlerRetryAdvice
RemoteLookupFailureException
配置
,该异常由
RmiClientInterceptor#lookupStub()
引起

<rmi:inbound-gateway request-channel="rmiRequestChannel"
                     registry-port="11099"
                     auto-startup="true"
                     request-timeout="5000"
                     reply-channel="rmiResponseChannel"
                     reply-timeout="5000" />

<int:chain input-channel="rmiRequestChannel" output-channel="rmiResponseChannel">
    <int:service-activator ref="hellowIntegrationRmi" method="hello"/>
</int:chain>

看起来您的消息在weblogic上的处理(和重新处理)速度比在tomcat上快。

请在tomcat在该异常上建立新存根时共享ExpException和日志。感谢它没有抛出任何连接异常并调用refreshAndRetry方法,但是引发了其他异常。我的spring集成版本是2.2.3。堆栈如下:java.lang.ClassCircularyError:org/springframework/integration/MessageDispatchingException位于org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:77)OK。看起来您的客户机正确地建立了
stub
。问题出在服务器上。不清楚为什么
MessageDispatchingException
ClassCircularityError
。但可能在不同的类加载器中有相同的spring integration jar副本。。。
<rmi:inbound-gateway request-channel="rmiRequestChannel"
                     registry-port="11099"
                     auto-startup="true"
                     request-timeout="5000"
                     reply-channel="rmiResponseChannel"
                     reply-timeout="5000" />

<int:chain input-channel="rmiRequestChannel" output-channel="rmiResponseChannel">
    <int:service-activator ref="hellowIntegrationRmi" method="hello"/>
</int:chain>