简体   繁体   中英

RMI - stub creation with rmic

I am stuck with creating stubs for my simple RMI implementation. With command line, I am at directory, where I have my class files stored.

For me it is: C:\\Users\\John\\Documents\\NetBeansProjects\\testServer\\build\\classes\\RMI

RMI here is the package I have my files in. Now when I am in this folder, I tri to make stubs with rmic -v1.2 -keep CountingOnServer, but command line writes me, that class CountingOnServer not found. No matter what I am doing, still it is writing such a unbelivable mistake... do you know how to solve that?

Thx

As a guess, issue is that CountingOnServer is inside some package, so you should use full name like RMI.CountingOnServer . Don't forget to run rmic from the the class-path root which in your case seems to be build\\classes directory.

If you have your RMI implementation in packages run rmic at the root of your class files, ex,

|-- build
|   |-- classes
|   |   `-- com
|   |       |-- client
|   |       |   `-- TestRMI.class
|   |       |-- rmi
|   |       |   |-- Hello.class
|   |       |   |-- HelloInterface.class
|   |       |   `-- Hello_Stub.class
|   |       `-- RMTServer
|   |           `-- RmiServer.class

I have my classes in build/classes/com/rmi directory so, to create stubs I can run rmic at the root as,

../build/classes/rmic com.rmi.Hello

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