简体   繁体   中英

RMI ClassNotFoundException _Stub

I've been trying multiple variations of this and have not succeeded at all. The following is what I'm writing on the command-line to start the RMI Server. I've started the rmiregistry while in the same folder (/usr/local/shared/.../RMIServer) and try to run the command below but still get a java.lang.ClassNotFoundException: FileDiscovery_Stub

java -Djava.security.policy=security.policy -Djava.rmi.server.codebase=file:/usr/local/shared/.../RMIServer/RMIFTServer.jar -jar RMIFTServer.jar

The jar file for the RMIServer is in the same folder (/usr/local/shared.../RMIServer) as well as the security.policy file needed.

Any help would be greatly appreciated.

Don't start the RMI registry in the same folder as the server. You don't want it to use the server's CLASSPATH, you want it to rely on the codebase feature.

Your class is out of date. If you specify port zero when exporting or constructing your remote object, you won't need a _Stub at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM