File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes Getting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Getting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object" Watch "Getting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object" New topic
Author

Getting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object

Renjith mohanan
Ranch Hand

Joined: Jun 19, 2009
Posts: 52
Hi Friends,
I am new to RMI technology.

When I am running the rmi client program, I am getting the exception : java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object.
I am using jdk1.5

The argument of the remote method is the Serialized object.

These are the server code...

This is the Remote Interface



This is the server implementation class

This is the class Order



I have the same Interface and Order class in Client also.

This is the client code


Could any one help me to how can I fix the problem ?

Thanks In Advance
Renjith M


Personal E-mail: kalliyoorrenjith@gmail.com
Renjith mohanan
Ranch Hand

Joined: Jun 19, 2009
Posts: 52
Renjith mohanan wrote:Hi Friends,
I am new to RMI technology.

When I am running the rmi client program, I am getting the exception : java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object.
I am using jdk1.5

The argument of the remote method is the Serialized object.

These are the server code...

This is the Remote Interface



This is the server implementation class

This is the class Order



I have the same Interface and Order class in Client also.

This is the client code


Could any one help me to how can I fix the problem ?

Do I need to set the java.rmi.server.codebase ?
If I do this, what should be the value of the java.rmi.server.codebase and please provide any link or some examples for how to do this ?

Thanks In Advance
Renjith M

Bupjae Lee
Ranch Hand

Joined: May 14, 2007
Posts: 107
Your server interface has "getOrder" method, and your server implemention and client use "getOrderFromCash" method

You can modify to match method names, and recompile all classes and try again.
Renjith mohanan
Ranch Hand

Joined: Jun 19, 2009
Posts: 52
Hi Bupjae Lee,
thanks for your reply.
Actual that was a mistake from my side. The client code is like this:



Thanks
Renjith M
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

Smells like the client and server code are not in sync.


apigee, a better way to API!
Renjith mohanan
Ranch Hand

Joined: Jun 19, 2009
Posts: 52
Hi Nitesh,
Thanks for your reply.
But I really didn;t get your point

"client and server code are not in sync"

could you please explain it.
Actually the problem is not able to pass the Serialized object (in my case that is custom class Order)

Thanks in Advance..

Renjith M
Bupjae Lee
Ranch Hand

Joined: May 14, 2007
Posts: 107
I don't think that the problem is serializing Order class.

The error message seems more like "NoSuchMethodException"

'Not in sync' means, there are some 'mismatches' between server and client

Try recompiling interface, server, and client together.
Renjith mohanan
Ranch Hand

Joined: Jun 19, 2009
Posts: 52
Thanks Bupjae Lee,

I have solved the problem.

I have set the classpath environment variable to the root directory of Order class.

Now I am able to call the remote method from local host.

But I am getting other exception, when trying to execute the remote method from different computer.

One computer is running as the server (eg: server ip is 192.168.1.108).
My client code is exactly like this:


The exception I am getting is:



I don't know, why this error occurs. I am able to ping the two computers and checked the port in the server and it is all working.
The two computers are running in Ubuntu.
But my confusion is why the above exception points to the ip 127.0.1.1 even though I am connecting to the ip 192.168.1.108 (ip of server).

Any Ideas ?

Thanks In Advance

Renjith M



Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

This is because on your server machine the localhost resolves to 127.0.1.1.
Search for java.rmi.server.hostname here to get more information.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Getting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object