Java 11, RMI, CORBA, and EJBs
As part of a new project, I explored the possibly of re-using an EJB. This is to leverage the existing business logic rather than creating a copy which would then need to also be maintained.
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
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
- JEP 320: Remove the Java EE and CORBA Modules
- GlassFish-Corba
- Maven Repository Artifacts