Apr 6th, 2011, 07:54 AM
Setting Dynamic RMI Registry Port
I have the following method that is calling without a problem but i had a problem where multiple instance are placed on the same instance which caused problem with the RMI port 1234
<bean id="rmiServieBean" class="org.springframework.remoting.rmi.RmiService Exporter">
<property name="serviceName" value="delivery-service"/>
<property name="service" ref="deliveryService"/>
<property name="serviceInterface" value="com.fp.common.model.bo.RmiMessageSending"/>
<property name="registryPort" value="1234"/>
The question is how we can make the "registryPort" dynamic, how can we assign a value to it from java for example???
Apr 12th, 2011, 05:48 AM
Change Registry port
I have not done it before but...
The setter methiod of rmi.RmiServiceExporter is a public method which means you can set the port. So try this
After loading appli***.xml file. get the bean named as "rmiServiceBean" and cast it to RmiServiceExporter. Then it will allow you to change the port.
I have not tried yet... either try it or wait 1-2 days I will try and let you know.