wood burning stoves 2.0*
The moose likes Distributed Java and the fly likes RMI Connection Refused after some clients connected successfully 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 » Java » Distributed Java
Bookmark "RMI Connection Refused after some clients connected successfully" Watch "RMI Connection Refused after some clients connected successfully" New topic
Author

RMI Connection Refused after some clients connected successfully

Albert Zilberman
Greenhorn

Joined: Mar 21, 2001
Posts: 6
Hello!
We have a problem with RMI Connection.
We have a RMI server that is using the factory pattern and client applets connecting to it.
When the application starts, a remote object, that is the RMI
home object ,is registered in the RMI registry.
On every client that connects to the server the home object creates another remote object that serves the client.
The clients connect to the remote home object by invoking the
method 'Naming.lookup(name)' and then invokes a remote method on that object.
After several successful connections to the server the problem starts:
the method 'Naming.lookup(name)' returns a reference to the remote home object but invoking a method on that remote reference
throws a 'ConnectionException' with the message "Connection refused to host..". from now on it is impossible to invoke remote methods on the remote objects.
We tried to connect to use telnet to connect to the port that
the RMI object is listening on but with no success.
Also we saw that the server have a listener on this port but it seems that the port disconnected
After 15 minutes the listener is available and new clients can connect and invoke methods again.
This happen with random client and we can't recreate the problem.

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Ur object is collected by garbage collector.Try to crate ur server object as static so that garbage collector won't touch ur server object.
bye
suresh
M Prathip
Greenhorn

Joined: Jul 05, 2001
Posts: 1
This is my first mail greenhorn. I also have this same problem, and thought it is the problem with the garbage collection and I ran a thread to keep the object alive , assuming the garbage collection want collect it. But it didn't work.
Please help me on this.
M.Prathip
Anthony Cunningham
Greenhorn

Joined: Jul 13, 2001
Posts: 4
I have this problem now too, some clients connect okay then this exception starts to occur.
Anthony Cunningham
Greenhorn

Joined: Jul 13, 2001
Posts: 4
This is probably a stupid question but if its being garbaged collected why would it work at a later stage without a server/rmiregistry restart in between.
 
 
subject: RMI Connection Refused after some clients connected successfully
 
Similar Threads
how to get Clients CPU information on Server using Java RMI
RMI * java.net.ConnectException * occurs when client on remote computer
RMI deployed on Apache/Tomcat
RMI Client connecting to port other than 1099
Client server Starting Order?