This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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
 
Have you checked out Aspose?
 
subject: RMI Test with many threads
 
It's not a secret anymore!