JDK-4384670 : Error encountered processing RMI call: Connection refused to host:
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Affected Version: 1.2.2_06
  • Priority: P2
  • Status: Closed
  • Resolution: Not an Issue
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 2000-10-31
  • Updated: 2015-12-15
  • Resolved: 2000-12-07
Related Reports
Relates :  
Description
I can obtain a reference to a remote object
from an RMI registry, but as soon as I attempt to execute any of
its methods, I get the following error. I ran the testcase in jdk 1.2.2_06.
The CLASSPATH env variable is set to 
/home/mala2/sandbox/JavaClasses:/net/jtech/export/javaprod/jdk1.2.2_006/jdk1.2.2/lib

smala:/home/mala2/sandbox/JavaClasses/delaware 73 % java -Djava.security.policy=/home/mala2/sandbox/JavaClasses/delaware/rmi.policy.txt delaware.registerRMI
Successfully bound omniDivCalc to RMI Registry
smala:/home/mala2/sandbox/JavaClasses/delaware 75 % java -Djava.security.policy=/home/mala2/sandbox/JavaClasses/delaware/rmi.policy.txt omnifund.testRMICall
java.security.policy = /home/mala2/sandbox/JavaClasses/delaware/rmi.policy.txt
RMI Object #1 is rmi://129.149.141.204:1099/omniDivCalc
Before Naming.lookup() of //129.149.141.204:1099/omniDivCalc
 after Naming.lookup(): divCalc.toString() = omnifund.divCalculatorImpl_Stub[RemoteStub [ref: [endpoint:[129.149.141.204:44063](remote),objID:[-2ce94f46:e28c6a630b:-8000, 0]]]]
Before getName() call
Error encountered processing RMI call: Connection refused to host: 129.149.141.204; nested exception is: 
        java.net.ConnectException: Connection refused
java.rmi.ConnectException: Connection refused to host: 129.149.141.204; nested exception is: 
        java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java, Compiled Code)
        at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java, Compiled Code)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java, Compiled Code)
        at java.net.Socket.<init>(Socket.java, Compiled Code)
        at java.net.Socket.<init>(Socket.java, Compiled Code)
        at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java, Compiled Code)
        at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java, Compiled Code)
        at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java, Compiled Code)
        at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java, Compiled Code)
        at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java, Compiled Code)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java, Compiled Code)
        at omnifund.divCalculatorImpl_Stub.getName(Unknown Source)
        at omnifund.testRMICall.main(testRMICall.java, Compiled Code)




Comments
EVALUATION It's difficult to evaluate the described behavior without a concrete test case. It appears, however, that for some reason, the VM containing the bound remote object has gone down. It's not entirely clear from the supplied run script, but it looks as if the VM that creates and binds the remote object then terminates before the client VM executes. If that is indeed the case, then that would explain the failure: with the server VM down, there is no server to accept the RMI connection. Just because a binding remaining the RMI registry does not guarantee that the remote object is still alive. peter.jones@East 2000-11-29 After being provided with the submitter's test case and running it, I have confirmed the above suspicion: the test case incorrectly shuts down the VM that contains the registered remote object before the client code is executed. Therefore, this is not a bug. peter.jones@East 2000-12-06
06-12-2000