Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

java.rmi.ConnectException: Connection refused to host

843810Jul 25 2005 — edited May 3 2009
Hi,
I am trying to get a RMI server running. I am using a windows 2000 client. I started with "start rmiserver". When I am trying to run my service by calling "java AccountServerImpl", I am getting the following exceptioion. Can someone help me find where I am missing ?.

java.rmi.ConnectException: Connection refused to host: 10.77.283.97; nested exception is:
java.net.ConnectException: Connection refused: connect
StackTrace
java.rmi.ConnectException: Connection refused to host: 10.77.283.97; nested exc
eption is:
java.net.ConnectException: Connection refused: connect
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown S
ource)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown S
ource)
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)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at AccountServerImpl.main(AccountServerImpl.java:56)

For registering, I am using the following statement.
Naming.rebind("rmi//10.77.283.97/AccountServer",instance);

TIA,
NBG

Comments

843810 Aug 17 2005
What is the Port in which you are ruinning the RMI?

You need to mention the port.

Simply chek if you have proper connectivity to the Server and the RMI Service as the speicifed port, try the debugging commands from command prompt like:

D:>telnet <Server IP Address> <Port Number>
If this command clears the windows into a blank window as if waiting for you input then it means that you have access to the Server and the RMI service is running on the machine.

If not, it is either NOT accessible or RMI Service is not working.

Thanks and regards,
Pazhanikanthan. P
843810 Aug 17 2005
I am seeing the same exception the first message reported. And I was able to do the telnet on the port that I have the RMI server running. Any ideas why I am seeing the connection being refused? I am running on port 9999. Thanks.
843810 Aug 18 2005
There are 2 things to consider while configuring the RMI Service.

1. RMI Registry Port
2. Calling the RMI using the Port.

You need to use something like
Naming.rebind("rmi//10.77.283.97:portnumber/AccountServer",instance);
Thanks and regards,
Pazhanikanthan. P
843810 May 3 2009
Hi,

Even i get the below error. I've checked the RMI server and it is connecting. But while running some service i get this error, which stops me from moving further. Can anyone help. This is urgent for me.


2009-05-03 19:02:45,482 [jConManRMIServer] ERROR com.jbase.jconman - Server error rebind on sb_app01:1066/jConman Connection refused to host: 10.32.21.16; nested exception is:
java.net.ConnectException: A remote host refused an attempted connect operation.

Thanks,
1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 31 2009
Added on Jul 25 2005
4 comments
783 views