Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

RMI Connection Refused after some clients connected successfully

 
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.

 
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
 
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
 
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.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic