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 using
ApplicationContext.getBean("myBean")
and pass it other service.
If for some reason myServiceUrl fails and restarts, the above setting is able to reconnect it.

Application Two:
<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>
Here I inject the RMI bean
<bean id="otherBean"
class="otherBeanClassNameWithPath"
p:myBean-ref="myBean"
/>
But if now myServiceUrl fails and restarts, my application is not able to reconnect to the server.