DEV Community

David Harrison
David Harrison

Posted on

3 2

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

Hot sauce if you're wrong - web dev trivia for staff engineers

Hot sauce if you're wrong · web dev trivia for staff engineers (Chris vs Jeremy, Leet Heat S1.E4)

  • Shipping Fast: Test your knowledge of deployment strategies and techniques
  • Authentication: Prove you know your OAuth from your JWT
  • CSS: Demonstrate your styling expertise under pressure
  • Acronyms: Decode the alphabet soup of web development
  • Accessibility: Show your commitment to building for everyone

Contestants must answer rapid-fire questions across the full stack of modern web development. Get it right, earn points. Get it wrong? The spice level goes up!

Watch Video 🌶️🔥

Top comments (0)