Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Connection Refused after some clients connected successfully

 
Albert Zilberman
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this problem now too, some clients connect okay then this exception starts to occur.
 
Anthony Cunningham
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic