The strangest RMI connection error

Hi all,

i have a client server application that uses RMI. The server has the following network configuration. It has 2 network interfaces.

hostnameifaceIPnetmask

====================================

sakurae1000g0 203.126.56.80 255.255.255.224

nc_apps5 e1000g1 10.224.100.18 255.255.0.0

when the server application listens on 203.126.56.80 iface, the client

has no problem establishing RMI connection from 10.224.10.122 netmask 255.255.0.0

via a static route with a route in between.

However when I switched the server over to 10.224.100.18, and connects from the same client ( no configuration change) , i get the error

[Wed Oct 11 14:38:53 SGT 2006 darkstar] ERROR calling: NetworkTestClient.performTest() called: Naming.lookup() args: rmi://nc_apps5.ncc.shs.com.sg:10000/RMITest

java.rmi.ConnectException: Connection refused to host: 10.224.10.122; nested exception is:

java.net.ConnectException: Connection refused

at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)

at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)

at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)

If anything the second scenario should work, because both the server and the client are in the subnet i.e 10.224.x.x. but it turns to be the opposite. Can anyone

tell me what gives over here.

Many Thanks in advance

Henley from Singapore. National Cancer Center.

[1506 byte] By [henleyhora] at [2007-10-3 7:03:08]
# 1
Naming.lookup() got 'Connection refused to host: 10.224.10.122'. According to what you've written above, that's the IP address of the client, not the server. Check the URI you're supplying to Naming.lookup() in the client code.
ejpa at 2007-7-15 1:56:32 > top of Java-index,Core,Core APIs...
# 2

Thanks for pointing that out. its not a mistake. I do not have access to the source of the application. However I am wondering why is the client trying to connect back to itself in the second scenario when its supposed to be connecting to 10.224.100.18. ip of the server.

Its very strange because the connection was apparently successful when

the the client tries to connect to 203.126.56.80. instead of 10.224.100.18 i.e no error.

is there anycode in the RMI that says, if server is in the same ip as me, try connecting to myself first ?

once again thanks in advance.

henleyhora at 2007-7-15 1:56:32 > top of Java-index,Core,Core APIs...
# 3
I suspect the error message is wrong - contact the vendor.When you start the server JVM, set the system property -Djava.rmi.server.hostname to its desired IP address.
ejpa at 2007-7-15 1:56:32 > top of Java-index,Core,Core APIs...