JEP 320: Remove the Java EE and CORBA Modules

OwnerLance Andersen
TypeFeature
ScopeSE
StatusClosed / Delivered
Release11
Componentother-libs
Discussionjdk dash dev at openjdk dot java dot net
EffortM
Reviewed byAlan Bateman, Alex Buckley, Brian Goetz, Mark Reinhold
Created2017/10/11 18:36
Updated2023/06/16 00:35
Issue8189188

Summary

Remove the Java EE and CORBA modules from the Java SE Platform and the JDK. These modules were deprecated in Java SE 9 with the declared intent to remove them in a future release.

Motivation

Java SE 6 included a full Web Services stack for the convenience of Java developers. The stack consisted of four technologies that were originally developed for the Java EE Platform: JAX-WS (Java API for XML-Based Web Services), JAXB (Java Architecture for XML Binding), JAF (the JavaBeans Activation Framework), and Common Annotations. At the time of inclusion, the versions in Java SE were identical to the versions in Java EE, except for Java SE dropping a package in Common Annotations that concerned the Java EE security model. However, over time, the versions in Java EE evolved, which led to difficulties for the versions in Java SE:

Since standalone versions of the Java EE technologies are readily available from third-party sites, such as Maven Central, there is no need for the Java SE Platform or the JDK to include them.

Another case of Java SE including technologies for developer convenience dates back to 1998. Under Ken Cavanaugh's distinguished leadership, Java SE embraced CORBA by shipping the OMG CORBA API, an ORB implementation, a CosNaming implementation, the idlj compiler, and support for IDL and IIOP in the rmic compiler. However, over time, support for CORBA became problematic:

Since the costs of maintaining CORBA support outweigh the benefits, there is no case for the Java SE Platform or the JDK to include it.

Finally, Java SE has included a subset of JTA (Java Transaction API) since Java SE 1.3 and a subset of the J2EE Activity Service for Extended Transactions (J2EE Activity Service) since Java SE 5.0.

JTA consists of two packages that play different roles and deserve different treatment:

The J2EE Activity Service defines a generic middleware API. It has not been updated since 2006 and is not part of the Java EE Platform. It is relevant to this JEP only because Java SE includes a subset of one of its packages, javax.activity, for interoperation with CORBA transaction services. This "activity package" exists in the java.corba module in Java SE 9.

Without CORBA support in the Java SE Platform or the JDK, there is no case for including the CORBA interop package from JTA or the activity package from the J2EE Activity Service.

Description

In Java SE 9, the Java SE modules that contained Java EE and CORBA technologies were annotated as deprecated for removal, indicating the intent to remove them in a future release:

Related modules in Java SE 9 were also deprecated for removal:

Since deprecating modules for removal merely causes compile-time warnings, JDK 9 took a more robust step to prepare developers for the actual removal of these modules in a future release: The modules in the JDK runtime image were not resolved when compiling or running code on the class path. This allowed developers on JDK 9 to deploy standalone versions of the Java EE and CORBA technologies on the class path, just like on JDK 8. Alternatively, developers on JDK 9 could use --add-modules on the command line to resolve the modules in the JDK runtime image.

In Java SE 11, the nine modules that are listed above will be removed:

The rmic compiler will be updated to remove the -idl and -iiop options. Consequently, rmic will no longer be able to generate IDL or IIOP stubs and tie classes.

The JDK documentation and man pages will be updated to remove any references to these modules and tools, and to indicate the rmic changes.

Testing

All JDK, JCK, and SQE tests that exercise the Java EE or CORBA APIs will be removed.

Risks and Assumptions

Java EE modules

The risk of removing the Java EE modules is that applications will not compile or run if they rely on "out of the box" support in the JDK for Java EE APIs and tools. These applications will experience binary and source incompatibilities when migrating from JDK 6, 7, or 8, to JDK 9 or a later release. Generally speaking, these applications fall into one of two categories:

  1. Standalone programs that manipulate Web Services and XML, outside of a Java EE application server.

  2. Applications that have no connection to Web Services or XML, but rely on individual classes in the Java EE APIs for general-purpose functionality. For example, some applications rely on JAXB not for XML binding, but rather, for the Base64 support offered by the class javax.xml.bind.DatatypeConverter. (Historically, this class was a better choice than the class sun.misc.Base64{Encoder,Decoder}, though better still is the class java.util.Base64 that was introduced in Java SE 8.) As another example, some applications rely on the @Generated annotation whose type, javax.annotation.Generated, is co-located with JAX-WS in JDK 9. (Applications may choose instead to rely on the type javax.annotation.processing.Generated that was introduced in Java SE 9.).

Another risk of removing the Java EE modules is that applications which already migrated from JDK 6, 7, or 8, to JDK 9, will not start if they use the command line flag --add-modules java.se.ee, --add-modules java.xml.bind, etc.

This proposal assumes that developers who wish to compile or run applications on the latest JDK can find and deploy alternate versions of the Java EE technologies. The Reference Implementations (RIs) of JAX-WS and JAXB are a good starting point because they are complete replacements for the java.xml.ws and java.xml.bind modules in JDK 9. The RIs are available as Maven artifacts: (note that they must be deployed on the class path)

The tools for JAX-WS and JAXB are also available as Maven artifacts:

There are also Maven artifacts that contain just the APIs of the Java EE technologies:

After this JEP is implemented these API JAR files may be deployed on the class path, just like on JDK 8 and 9. They may also be deployed on the module path so that modular applications can depend on them via the requires directive:

On JDK 9, all the modules mentioned in the Description (except for the java.se.ee aggregator) are upgradeable. This means that developers on JDK 9 who use --add-modules java.xml.bind etc have the choice of either relying on the Java EE modules in the JDK runtime image, or overriding them by deploying API JAR files on the upgrade module path. Note the involvement of the upgrade module path rather than the module path; deploying API JAR files on the module path on JDK 9 has no effect, even when --add-modules java.xml.bind etc is used, because the Java EE modules in the JDK runtime image are preferred to modules with the same name on the module path. After this JEP is implemented, the Java EE modules will not be present in the JDK runtime image, so developers can deploy API JAR files on the module path.

CORBA and JTA modules

The risks of removing the java.corba module are:

  1. CORBA implementations will not compile or run if they include only a subset of the "endorsed" CORBA APIs and expect the JDK to provide the remainder.

  2. Applications and CORBA implementations that use RMI-IIOP will not compile or run. The RMI-IIOP packages (javax.rmi and javax.rmi.CORBA) are located in the java.corba module and tied to the CORBA implementation therein, so there will be no RMI-IIOP support in Java SE once java.corba is removed.

  3. Applications and CORBA implementations that use the javax.activity package will not compile or run. This package is located in the java.corba module and tied to the CORBA implementation therein, so there will be no support in Java SE once java.corba is removed.

There will not be a standalone version of CORBA unless third parties take over maintenance of the CORBA APIs, ORB implementation, CosNaming provider, etc. Third party maintenance is possible because the Java SE Platform endorses independent implementations of CORBA. In contrast, the API for RMI-IIOP is defined and implemented solely within Java SE. There will not be a standalone version of RMI-IIOP unless a dedicated JSR is started to maintain it, or stewardship of the API is taken over by the Eclipse Foundation. The transition of stewardship of Java EE from the JCP to the Eclipse Foundation includes the GlassFish implementation of CORBA and RMI-IIOP. Finally, there is no standalone version of the J2EE Activity Service.

A standalone version of JTA is available as the Maven artifact javax.transaction : javax.transaction-api. As of November 2017, this JAR file represents JTA 1.2, which consists of both the XA package and the CORBA interop package. In early 2018, JTA 1.3 will be defined to consist of just the CORBA interop package; the JAR file will be updated accordingly. The JAR files for JTA 1.2 and JTA 1.3 may be deployed as follows: