Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI Exception

 
Jawad Kakar
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
 
John Smith
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic