When I
test my rmi communication by putting all classes of client and server in one directory, the result is OK. But when I place the classes of client and server in different directory, some issue take place as follows.
Three kinds of problems in different environment:
1. set classpath=null->change to the directory where can't find any class->start rmiregistry->set classpath to the classes of server including the stub->change to another directory to start sererv->error: java.rmi.ServerException:RemoteException occured in server
thread; nested exception is: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: java.lang.ClassNotFoundException: FBNImpl_Stub.
2. set classpath to the classes of server including stub->start rmiregistry->start server(server running OK)->set classpath to the classes either in the client or in the server->run client->
Error: Can't find FBNImpl_Stub (in fact, FBNImpl_Stub was placed in the directory of client physically)
3. set classpath to the classes of server including stub->start rmiregistry->start server(server running OK)->set classpath only to the classes in the client->run client->Error: java.lang.NoClassDefFoundError: FBN ( FBN is the common interface either in the client and server, it was actually put in the directory of the client)
Who can tell me why? Thanks in advance.