File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
David Duran
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7292
Netbeans IDE VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your non-abbreviated example, did cast the return of the Naming.lookup operation to (RemoteInterface)?
 
David Duran
Ranch Hand
Posts: 122
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the actual code does the correct casting.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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."
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic