Am having two applications:
Application One:
<bean id="myBean"
class='org.springframework.remoting.rmi.RmiProxyFa ctoryBean'>
<property name="serviceUrl">
<value>rmi://${myServiceUrl}/MyObject</value>
</property>
<property name="serviceInterface">
<value>MyClassNameWithPath</value>
</property>
<property name="lookupStubOnStartup">
<value>false</value>
</property>
<property name="refreshStubOnConnectFailure">
<value>true</value>
</property>
</bean>
I get myBean bean object usingand pass it other service.ApplicationContext.getBean("myBean")
If for some reason myServiceUrl fails and restarts, the above setting is able to reconnect it.
Application Two:
Here I inject the RMI bean<bean id="myBean"
class='org.springframework.remoting.rmi.RmiProxyFa ctoryBean'>
<property name="serviceUrl">
<value>rmi://${myServiceUrl}/MyObject</value>
</property>
<property name="serviceInterface">
<value>MyClassNameWithPath</value>
</property>
<property name="lookupStubOnStartup">
<value>false</value>
</property>
<property name="refreshStubOnConnectFailure">
<value>true</value>
</property>
</bean>
But if now myServiceUrl fails and restarts, my application is not able to reconnect to the server.<bean id="otherBean"
class="otherBeanClassNameWithPath"
p:myBean-ref="myBean"
/>


Reply With Quote