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

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up