This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 Exception

 
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am testing locking mechanism by creating threads and each thread hold it own connection to the server, but after 50 or so connection I get connection exception.

java.rmi.ConnectException: Connection refused to host: 63.188.161.231; nested exception is:
java.net.ConnectException: Connection refused: connect


Client and Server are running on same the computer.
Jawad
 
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am testing locking mechanism by creating threads and each thread hold it own connection to the server, but after 50 or so connection I get connection exception.


This is a common problem and several people have reported it, including me. Apparently, Sun's RMI implementation is not industrial strength, and it gets choked when bombarded with multiple connection requests. Some app server vendors, such as Weblogic, opted to provide their own implementation of RMI.
Just test with less than 50 connections, you will be fine. Or, you may want to sleep() a bit betweeen making connections.
Eugene.
[ December 10, 2002: Message edited by: Eugene Kononov ]
 
Jawad Kakar
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eugene,
Thank you for your reply, sleep() is a good idea for testing.One more thing I did not implement the unreference interface, instead I have a worker thread which clean the old clients locks and assumes they have crashed, do you think it is ok? Did people lost marks by doing so?
Jawad
[ December 10, 2002: Message edited by: Jawad Kakar ]
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


instead I have a worker thread which clean the old clients locks and assumes they have crashed, do you think it is ok? Did people lost marks by doing so?


Not sure about other people, but I didn't bother with any of this extra features and I got maximum score for my server design.
Eugene.
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic