RMI Sockets

  • Thread starter Reinhard Achleitner
  • Start date
R

Reinhard Achleitner

Hi!

Let me explain my problem i have with RMI:

I have a server application running behind a Router
I have clients running also behind routers.

The server and the client communicates with RMI. Also Callbacks from server
to client has to be made.

After hours of experimenting it works that the client can connect to the
server and receive callbacks from server.
To do this, i use two ports (one for the registry and one for the other
communication) and open this ports in the routers.

A Call to the server has always three steps:

1.) Call the server method
2.) Start a new Thread and create the result
3.) Send back the result via callback

The problem i have is, that if the creating of the result takes a little bit
longer (> 10 seconds approximatly) then
i get following exception:

java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.net.SocketException: Connection reset by peer: socket write error
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at
at.ccenter.common.base.communication.ServerCommunicator_Stub.processServerCa
ll(Unknown Source)
at
at.ccenter.server.base.as.ActivityServer.callActivity(ActivityServer.java:58
4)
at
at.ccenter.server.base.as.ActivityServer.processClientCall(ActivityServer.ja
va:444)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at sun.rmi.transport.Transport$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.SocketException: Connection reset by peer: socket write
error
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(Unknown Source)
at java.net.SocketOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.write(Unknown Source)
at java.io_ObjectOutputStream$BlockDataOutputStream.drain(Unknown Source)
at java.io_ObjectOutputStream$BlockDataOutputStream.writeByte(Unknown
Source)
at java.io_ObjectOutputStream.writeFatalException(Unknown Source)
at java.io_ObjectOutputStream.writeObject(Unknown Source)
at sun.rmi.server.UnicastRef.marshalValue(Unknown Source)
... 14 more

any ideas?

kind regards

Reinhard Achleitner
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top