wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes java.rmi.ConnectException while system testing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "java.rmi.ConnectException while system testing" Watch "java.rmi.ConnectException while system testing" New topic

java.rmi.ConnectException while system testing

Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
I am in the process of system testing my FBN system. I have main line code which instantiates threads in a loop to simulate multiple clients. After succesfully completing the execution for 15 times(15 threads), I get the exception below for the 16th thread:
Factory exception: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect
java.rmi.ConnectException: Connection refused to host: localhost; nested excepti
on is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Naming.java:83)
If I ask the main line code to sleep for 5 seconds after every 15 threads, the program runs fine indefinitely.
Any help is appreciated. I guess it is something to do with the maximum amount of sockets opened in my laptop. I am running the rmi server and the client in the same machine.
Thanks a lot.
Sri Addanki
Ranch Hand

Joined: Apr 27, 2001
Posts: 195
I am not sure if this helps, since none answered ur question, heres what i feel.
I used to get these errors when i tried to access remote methods, without starting rmiregistry. May be after sleep, or after 15 calls, there's something happening there, which is disabling the start rmiregistry.
or I think, if u have RMIsecurity Manager on the server side then put it on the client side.
I agree. Here's the link: http://aspose.com/file-tools
subject: java.rmi.ConnectException while system testing
Similar Threads
load testing and RMI ConnectionException
RMI Exception
EJB romte call Exception,"Connection refused to host: win2003..."
Help with JMX and Netbeans Tutorial (Outdated or broken)