File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI Exception" Watch "RMI Exception" New topic
Author

RMI Exception

Jawad Kakar
Ranch Hand

Joined: Oct 06, 2002
Posts: 82
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

Joined: Oct 08, 2001
Posts: 2937

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

Joined: Oct 06, 2002
Posts: 82
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

Joined: Oct 08, 2001
Posts: 2937

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.
 
wood burning stoves
 
subject: RMI Exception
 
Similar Threads
Class.forName("")
rmi exception
How to start server at the port which not 1099?
JavaMail and Lotus Notes chamber of secrets
java.rmi.ConnectException