Posts Tagged ‘It is likely that the remote side declared peer gone on this JVM’
java.net.ConnectException: (…) Bootstrap to (…) failed. It is likely that the remote side declared peer gone on this JVM
Case and Topology
RMI services are deployed on UAT, exposed via a F5, at the following address: t3://my-f5-frontal.my.domain.extension:7090
The actual servers are my-first-node.my.domain.extension
and my-second-node.my.domain.extension
.
The client application is deployed in a remote location, on a QA server.
The ports are open between QA and UAT, and we can ping and use telnet with no issue on QA.
Anyway, when I launch the client application from QA, I get the following error:
2011-10-31 06:41:03,277 INFO support.DefaultListableBeanFactory - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@79e304: defining beans [jonathanServiceClient]; root of factory hierarchy Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'smartServiceClient' defined in class path resource [com/lalou/jonathan/rmi-client-spring.xml]: Invocation of init method failed; nested exception is org.springframework.remoting.RemoteLookupFailureException: JNDI lookup for RMI service [rmiServices] failed; nested exception is javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://my-f5-frontal.my.domain.extension:7090: Bootstrap to my-f5-frontal.my.domain.extension/111.222.012.123:7090 failed. It is likely that the remote side declared peer gone on this JVM]
Explanation and Fix
Owing to my understanding, here is the point: when the client tries to connect to F5, it presents itself with its name, and the F5 returns the name of the actual server. If both client and server are not on the same domain (“domain” as network domain, no link with Weblogic domain), then the DNS resolution may fail.
To fix this issue, you have to follow one or both of the following points: everything depends on your local topology.
WebLogic: “Listen Address”
Modify the “Listen Address” in WebLogic administration console, from home: Servers > MyFirstNode/MySecondNode > Configuration > General > Listen Address > update it
By “update” the “Listen Address”, I mean providing the complete name of the machines, including the domain extension.
eg: my-first-node.my.domain.extension
and my-second-node.my.domain.extension
, rather than my-first-node
and my-second-node
(or, even worse, localhost
).
You can also provide an IP, cf. WebLogic documentation on Oracle’s website.
Of course, you can decide to set it directly in WebLogic’s config.xml
.
Caution! This option may also be set via the command line running WebLogic, using the flag -Dweblogic.ListenAddress=...
Therefore, take care to be consistent between the content of console/config.xml
and the command line option.
Hosts
On client side, check the content of hosts file. Usually, you can found it at /etc/hosts
(or C:\WINDOWS\system32\drivers\etc\hosts
on Windows XP).
Assuming your machine is myClientMachine
with an IP 123.123.123.123 and a domain extension remote.domain
, then your hosts file should look like:
127.0.0.1 localhost 123.123.123.123 myClientMachine
Update it to:
127.0.0.1 localhost 123.123.123.123 myClientMachine myClientMachine.remote.domain