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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

java.rmi.ConnectException while system testing

Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: Connection refused: connect
java.rmi.ConnectException: Connection refused to host: localhost; nested excepti
on is: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(
at sun.rmi.transport.tcp.TCPChannel.createConnection(
at sun.rmi.transport.tcp.TCPChannel.newConnection(
at sun.rmi.server.UnicastRef.newCall(
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(
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.
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
He baked a muffin that stole my car! And this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic