• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

can't run the server of the rmi??

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
}

}

}
 
Ranch Hand
Posts: 1258
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
reply
    Bookmark Topic Watch Topic
  • New Topic