File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes RMI Test with many threads Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI Test with many threads" Watch "RMI Test with many threads" New topic
Author

RMI Test with many threads

Sophie Siegel
Greenhorn

Joined: Aug 17, 2011
Posts: 9

Hallo,

I have a testclass for testing my methods with RMI Connection.

First the testclass starts the RMI Server and then it starts 500 threads in a for-Loop.
Every thread starts a client which make a registry.lookup and tests my methods on serverside.

With about less than 215 threads I don't have any problem. But more than about 215 threads I get this exception:

java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown Source)
at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown Source)
at sun.rmi.server.UnicastRef.newCall(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
at java.rmi.Naming.lookup(Unknown Source)
at

I test it with port 1099 and the following ipAddresses:
- my ip Address
- localhost
- 127.0.0.1

The test with starting server and all the clients runs on one machine.
Could this be the problem?

Thank you!
Sophie
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: RMI Test with many threads
 
Similar Threads
RMI deployed on Apache/Tomcat
Cannot Start RMI Server
Eclipse 3 with Jboss3.2.3 using Lomboz 3.0 -> CommunicationException
rmi and Tomcat 5.5 - java.net. Malformed URLException: no protocol: Files
Problem with Testing my RMI BusinessLogic with more than 200 Threads