aspose file tools*
The moose likes Distributed Java and the fly likes Strange exception when trying to make remote method call... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Strange exception when trying to make remote method call..." Watch "Strange exception when trying to make remote method call..." New topic
Author

Strange exception when trying to make remote method call...

David Duran
Ranch Hand

Joined: Feb 11, 2002
Posts: 122
Can anyone possibly explain to me who/what could be the culprit of the exception below?
Context: RMI client code in a jsp file running on Tomcat 4.0 tries to make a remote method call to a remote server. Simplified below:
RemoteInterface ri = (RemoteInterface)Naming.lookup("//.../RemoteServer");
ri.remoteFunc(); // Exception happens here!
I'm not sure how to interpret the exception- Is it a tomcat problem? Is is a client problem? A server problem? Can anyone shed some light? I would really appreciate it.
java.rmi.MarshalException: Error marshaling transport header; nested exception is:
java.net.SocketException: Connection reset by peer: Connection reset by peer
java.net.SocketException: Connection reset by peer: Connection reset by peer
at java.net.SocketInputStream.socketRead(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:90)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
at java.io.BufferedInputStream.read(BufferedInputStream.java:204)
at java.io.DataInputStream.readByte(DataInputStream.java:222)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:206)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
at sun.rmi.server.ActivatableRef.invoke(ActivatableRef.java:120)
at server.RemoteServer_Stub.remoteFunc(Unknown Source)
at org.apache.jsp.YourPage$jsp._jspService(YourPage$jsp.java:1054)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
...
at java.lang.Thread.run(Thread.java:484)

** EDIT **
I left out the casting to a RemoteInterface when I called Naming.lookup, but in the actual code it is there.
[ December 17, 2002: Message edited by: David Duran ]
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

In your non-abbreviated example, did cast the return of the Naming.lookup operation to (RemoteInterface)?


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
David Duran
Ranch Hand

Joined: Feb 11, 2002
Posts: 122
Yes, the actual code does the correct casting.
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

I'm tempted to say that whatever server your Tomcat is contacting probably doesn't like something about your handshake. I see this from time to time on servers that will not accept a "raw IP" address from clients -- you have to come from some domain or it will drop you.
I searched around a bit and I found multiple versions of this question, none of them answered. An error in transport is probably the general way of saying, "something beyond our control went wrong."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strange exception when trying to make remote method call...