Is rmic still needed?
Asked Answered
B

2

11

Is it true that the rmi interface compiler is not needed for java 1.5 or newer and that just compiling the java file where the UnicastRemoteObject is defined with javac is enough?Rmic still works and it generates a stub class file if you give it the class file of the implementation of the remote object.

Beason answered 15/1, 2011 at 23:56 Comment(0)
E
7

According to the RMI tutorial:

http://download.oracle.com/javase/tutorial/rmi/overview.html

Compiling Sources

As with any Java program, you use the javac compiler to compile the source files. The source files contain the declarations of the remote interfaces, their implementations, any other server classes, and the client classes. Note: With versions prior to Java Platform, Standard Edition 5.0, an additional step was required to build stub classes, by using the rmic compiler. However, this step is no longer necessary.

Eustazio answered 16/1, 2011 at 0:38 Comment(3)
But when Server is executed without Stub class, it gives StubNotFoundException.Blooded
Exception occured when using exportObject(object) but not when exportObject(object,0);Blooded
The tutorial is wrong. See the preamble to the Javadoc for UnicastRemoteObiect. You can avoid using rmic under specific circumstances, i.e. when you construct or export the remote object providing a port number parameter (even zero), for reasons described in the documentation.Yam
Y
1

See the preamble to the Javadoc for UnicastRemoteObiect. You can avoid using rmic under specific circumstances, i.e. when you construct or export the remote object providing a port number parameter (even zero), for reasons described in the documentation.

Yam answered 20/5, 2018 at 22:57 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.