Hi, all
I'm still new to RMI, so please be gentle
I'm trying to create an RMI server using netbeans, but I'm having some difficulties. Here is my code:
the interfaceJar:
The implementationJar:
1st class:
2nd class:
I build both jar and put them with this hierarchy in the server:
/opt/temp/implementationJar.jar
/opt/temp/lib/interfaceJar.jar
but when I run the command:
java -jar implementationJar.jar, i got following error:
java.rmi.UnexpectedException: undeclared checked exception; nested exception is:
java.lang.ClassNotFoundException: Could not find class (interfaces.Calculator) at codebase ()
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Naming.java:160)
at server.CalculatorServer.<init>(CalculatorServer.java:31)
at server.CalculatorServer.main(CalculatorServer.java:48)
Caused by: java.lang.ClassNotFoundException: Could not find class (interfaces.Calculator) at codebase ()
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:359)
What did I do wrong?