0

I m struggling with RMI. I m totally new at this and tried this tutorial

All my classes and interface compile well but when I try to run the Server class, I get some Exceptions (listed below) the project is build as follows:

-pakage hello
            --interface Hello.java
            --class Server.java
            --class Client.java

I'v done Somme research and they always suggested to change the security policy file. So I added following policy to java.policy:

grant 
{  
     permission java.security.AllPermission "", "";  
};

a secondary "question": I run Linux mint, so i came to understand that i don't need to run the rmiregistry, is that correct or do I need to start it as well and how can I do that.

The listed exceptions:

Server exception: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: hello.Hello
java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    java.lang.ClassNotFoundException: hello.Hello
    at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:419)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:267)
    at sun.rmi.transport.Transport$1.run(Transport.java:177)
    at sun.rmi.transport.Transport$1.run(Transport.java:174)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:811)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:670)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:275)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:252)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:378)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at hello.Server.main(Server.java:23)

Anybody who can help me?

Jorne De Blaere
  • 39
  • 2
  • 14

1 Answers1

1

The error clearly says that hello.Hello Class is not found. Please ensure that it is in classpath. You have everything in the link you have provided - Section Start the Java RMI registry, server, and client

Keerthivasan
  • 12,760
  • 2
  • 32
  • 53