Answer the question
In order to leave comments, you need to log in
Java RMI. How to implement communication between two clients through remote RMI registry?
Good day.
I decided to study Spring in my free time and set myself the task of writing 2 simple web applications. In one there are users, in the second city. And I would like to implement the connection of these applications with each other and the binding of users to cities. Decided to pick RMI. I created jar with Remote interface and put it in both projects. Well, like a half-kick started, but there are a couple of questions left. Now the 1st application starts in its rmi registry and registers the HelloService interface there and encloses a specific implementation. Everything is good, everything is great.
But when I tried to raise the RMI registry separately and on my own (rmiregistry), I constantly get exceptions and ClassNotFound and others.
Rummaged, read about some codebase and dynamic class loading in rmi. The loading class, as I understand it, only works for client applications, and I still don’t understand how to upload the code of the desired interface to the server.
Actually, the question is the following, in the rmi registry should there also be a jar with the necessary remote interfaces, or is it possible to somehow overcome this and feed everything you want in the registry with direct execution? And if not, is it even possible to implement it somehow?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question