Google 网上论坛不再支持新的 Usenet 帖子或订阅项。历史内容仍可供查看。

RMI problem

已查看 0 次
跳至第一个未读帖子

Manuela Onu

未读,
2001年5月13日 13:31:112001/5/13
收件人
Hi everybody !

I have the following RMI problem:

I am running a server object which I try to access from 100 threads running
simultaneously. In each thread I am calling Naming.lookup(serverObjectName)
to acquire the server object reference. Every once in a while I am getting
the following exception:

java.net.ConnectException: Connection refused: no further
information
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown Source)
at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown Source)
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)
<<<< one of the methods in my application here >>>

I am running on a W2K platform and I checked
HKEY_LOCAL_MACHINE/SYSTEM/Services/Tcpip/Parameters which seems to be OK.
However it looks like the system is unable to create a new socket
connection.

netstat shows around 200 sockets being active when the exception is thrown
(I am running both the client, server and rmiregistry on the same machine).

Does anybody know what the problem might be ? If I reduce the number of
threads (and implicitly the number of connections) I am consistently not
getting the error any longer.

Thanks very much

0 个新帖子