DEV Community

David Harrison
David Harrison

Posted on

Java 11: Making RMI calls and EJBs work again

As part of a new project, I explored the possibly of re-using an EJB. This is to leverage existing business logic rather than cloning, which would then need to also be maintained separately.

Attempting to Compile the EJB calling code in Java 11 served up a quick reminder. As part of JEP 320, the following are removed from Java.

  • java.corba module
  • javax.rmi.CORBA
  • javax.rmi (RMI-IIOP packages)

Example section of code which would not compile

Context context = new InitialContext();
Object raw = context.lookup(jndiName);
ARemoteType type = (ARemoteType )PortableRemoteObject.narrow(raw, ARemoteType .class);

Luckily, under the Eclipse Foundation's Java EE, the Glassfish implementation of CORBA and RMI-IIOP is available! Including the Gradle snippet below allowed the code to compile and work without any change.

implementation group: 'org.glassfish.corba', name: 'glassfish-corba-orb', version: '4.2.0'

References

Top comments (0)