0

Any implementation of Oracle's RMI protocol in python, .net or other non-Java language on GitHub? So far the one I found teaches you how to implement an RMI protocol from scratch. What I want is to implement Oracle's/Java's RMI protocol in Python or .NET

The specs here : https://docs.oracle.com/javase/9/docs/specs/rmi/protocol.html

Shouldn't be difficult as the protocol begins with RMI:// Either the stub or skeleton can be done in Python.

Nederealm
  • 447
  • 4
  • 15
  • Not possible in general. RMI runs over Java Object Serialization, so in general you will need a Java JVM with access to all referenced classes in the same serialization-version as used by the sender. – user207421 Feb 07 '22 at 09:40

1 Answers1

1

As explained in this answer, it seems that java RMI is not designed to be implemented in other languages.

That answer indicates that it is easier with JVM-based languages though. But not Python, because you would have to re-implement the entire RMI protocol. Would Jython be possible to use as implementation, instead of the popular (implicit) CPython ?

Otherwise, quoting Joni from its answer cited earlier :

It will be easier to add a REST API to the Java service, which you can then call from .Net or from the Electron app.

The same goes for Python : just call a REST service in Java-land, instead of implementing the full RMI protocol.

Lenormju
  • 4,078
  • 2
  • 8
  • 22
  • 1
    CORBA and RMI are dead protocols. Simple and open won. HTTP and REST are the way to go. – duffymo Feb 04 '22 at 16:20
  • @duffymo right, but sometimes you have a legacy behemoth that is still using RMI, and you may have to do it anyway. Though it would be quite the undertaking. – Lenormju Feb 04 '22 at 16:23
  • Jython's been dead for decades. Not a good idea to use it for any new development. – Voo Feb 04 '22 at 16:23
  • Your legacy behemoth is the real problem. What plans are you making to modernize it? You're only making it worse with your proposed solution. Write an interface-based REST service in Java that uses RMI underneath. Better than writing RMI from scratch. – duffymo Feb 04 '22 at 16:24
  • @duffymo I'm not the OP, but I can imagine one case where it would be helpful : you already have the functionality implemented with Java RMI, and you need to call it from Python. But as suggested, adding a second entrypoint is probably simpler than to deal with RMI. – Lenormju Feb 04 '22 at 16:28
  • 1
    Agreed - wrap it in REST and call that from Python. – duffymo Feb 04 '22 at 17:00