Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can't run the server of the rmi??

 
Barry Tsai
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I had generate the stub and skel using the rmic command.
And then when I want to run the server, it output ClassNotFoundException.
how is going on???
The following is my command and src.
java server.FibonacciServer
Exception in FibonacciServer: java.rmi.ServerException: RemoteException occurred
in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: server.FibonacciImpl_Stub
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: server.FibonacciImpl_Stub
at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:352

<<server source>>
package server;

import java.net.MalformedURLException;
import java.rmi.*;

public class FibonacciServer {

public static void main(String[] args) {

try {
FibonacciImpl f = new FibonacciImpl();
Naming.rebind("/fibonacci", f);
System.out.println("Fibonacci Server ready.");
}
catch (RemoteException re) {
System.out.println("Exception in FibonacciServer: " + re);
re.printStackTrace();
}
catch (MalformedURLException e) {
System.out.println("MalformedURLException " + e);
e.printStackTrace();
}

}

}
 
Nathaniel Stoddard
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it appears that your generated stub/skeleton isn't included in your classpath when you're invoking your program. This is just a regular classpath problem. (i.e. 1) find the class, 2) include it in your classpath).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic