Answer the question
In order to leave comments, you need to log in
How to create a remote service in JAVA using RMI?
1) I create a remote interface.
2) I create an implementation of the remote interface
3) We generate "stubs" and "skeletons" using the rmic utility
and then an error ...
Warning: generation and use of skeletons and static stubs for JRMP
is deprecated. Skeletons are unnecessary, and static stubs have
been superseded by dynamically generated stubs. Users are
encouraged to migrate away from using rmic to generate skeletons and static
stubs. See the documentation for java.rmi.server.UnicastRemoteObject.
error: Class MyRemoteImpl not found.
1 error
Answer the question
In order to leave comments, you need to log in
The rmic utility is indeed outdated. You can see current examples of use, for example, in this article habrahabr.ru/post/74639 .
To use Rmi, you no longer need to generate stubs yourself using utilities, they are generated directly in the code using the UnicastRemoteObject.exportObject(service, 0);
.
You may also need to set up a security policy to run RMI. To do this, create a file server.policy
with the following content:
grant {
permission java.security.AllPermission;
};
-Djava.security.policy=server.policy
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question