I am working on an application built upon a spring 2.0 stack with a rich client connecting to a server through RMI. The server is listening for incoming connections on an RMI registry which port has been set in the spring descriptor:
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName" value="service.context" />
<property name="service" ref="service.context" />
<property name="serviceInterface" value="myApp.context.IServerContext" />
<property name="registryPort" value="${server.port}" />
</bean>
When the connection happens, we also establish an RMI Callback capability with a class that extends UnicastRemoteObject.
But I cannot find a way to specify on which port (or range of ports) this connection will establish. That was not a problem until my corporate network has decided to implement strong firewall policies.
Now I would like to know (or decide) what ports will be used so that they can be declared in the firewall.
Specify the port number via super(port) in the constructor of the callback class.