Note that there are some explanatory texts on larger screens.

plurals
  1. POGetting java.rmi.UnmarshalException: unrecognized method hash: method not supported by remote object
    text
    copied!<p>I am new to RMI technology.</p> <p>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</p> <p>The argument of the remote method is the Serialized object.</p> <p>These are the server code...</p> <p>This is the Remote Interface</p> <pre><code>package interfacepackage; import java.rmi.Remote; import java.rmi.RemoteException; public interface ServerInterface extends Remote{ public void getOrder(Order order) throws RemoteException; } </code></pre> <p>This is the server implementation class </p> <pre><code>public class ServerImplementation implements ServerInterface { public ServerImplementation() throws RemoteException { } public void getOrderFromCash(Order order) throws RemoteException { System.out.println("WORKED"); } public static void main(String[] args) try { java.rmi.registry.LocateRegistry.createRegistry(1234); ServerImplementation service = new ServerImplementation(); ServerInterface myRemoteObject = (ServerInterface) UnicastRemoteObject .exportObject(service, 0); java.rmi.registry.Registry registry = java.rmi.registry.LocateRegistry .getRegistry("localhost", 1234); registry.rebind("ServerImplementation", myRemoteObject); } catch (Exception ex) { ex.printStackTrace(); } } } </code></pre> <p>This is the class Order </p> <pre><code>public class Order implements Serializable{ private static final long serialVersionUID = 1L; private int id; private String name; public Order(int id,String name){ this.id=id; this.name=name; } } </code></pre> <p>I have the same Interface and Order class in Client also.</p> <p>This is the client code </p> <pre><code>public class TestClientProgram { public static void main(String[] args) { try{ java.rmi.registry.Registry registry = java.rmi.registry.LocateRegistry.getRegistry("localhost",1234); ServerInterface service=(ServerInterface) registry.lookup("ServerImplementation"); Order orderObject=new Order(1,"dish"); service.getOrderFromCash(orderObject); } catch(Exception e){ e.printStackTrace(); } } } </code></pre> <p>Could any one help me to how can I fix the problem ?</p> <p>Thanks In Advance Renjith M </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload