At the time when first modular Java was released in September 2017 [0]
JBoss Modules team have already been working on proper integration with it
[2].
That effort was finished 7 months later after Java 9 initial release and
JBoss Modules version supporting Java's JPMS modules was integrated into
WildFly in April 2018.
During the JBoss Modules 1.8.0.Final merge into WildFly some legacy and
WildFly specific modules have been deprecated, see [2] and [3]. These are:
* ibm.jdk (aggregation module for IBM JDK8 internals)
* javax.api (aggregation module for some Java's official APIs)
* javax.xml.stream.api (streaming api)
* javax.sql.api (sql api)
* sun.jdk (aggregation module for SUN JDK internals)
We created and defined these modules over time as WildFly was developed
and before
Java got modularized via [5]. But with introduction of modular Java
everything changed
and there is no more reason to use these legacy modules that we came up in
the past.
It is preferred and recomended to use official Java JPMS modules instead.
All five obsolete modules were deprecated in the past but second
important step
of removing references on them wasn't completed yet and so they are still
being used
in both WildFly and WildFly Core. Now before EAP8 goes final is the right
time
to clean it up and complete the migration to standard Java's JPMS modules
and ideally
get rid of these five deprecated modules. Another option is to keep them
(although
unreferenced) in WildFly & EAP8 for backwards compability.
There were identified two areas of above deprecated modules usages:
a) module.xml files in WildFly Core and WildFly
b) server runtime code
To migrate to Java JPMS modules it is important to know which JPMS
module(s) should be
used/referenced instead. Following is the mapping of legacy WildFly modules
to Java JPMS modules:
1) ibm.jdk deprecated module cannot be migrated to standard Java JPMS
module. This module was introduced
because we needed some of IBM JDK8 internals to be available in WildFly
in the past.
When WildFly Core and WildFly code base moved to modular JDKs (JDK11
and above) this legacy module
is not needed anymore. It is because recent IBM JDK 11 and above are
based on OpenJDK and its JPMS modules architecture.
References to that module can be eliminated completely without any
further migration.
2) javax.api deprecated module will be replaced with one or some of the
following JPMS modules it aggregates:
- java.se
- jdk.xml.dom
where java.se is also Java's JPMS aggregation module and it can be
further dereferenced to smaller JPMS modules that are only needed
3) javax.xml.stream.api will be replaced with java.xml JPMS module
4) javax.sql.api deprecated module will be replaced with one or some of
the following JPMS modules it aggregates:
- java.sql
- java.sql.rowset
- java.transaction.xa
5) sun.jdk deprecated module will be replaced with one or some of the
following JPMS modules it emulates:
- modules whose name starts with jdk. prefix (note these are specific
to the JDK and will not necessarily be available in all Java
implementations)
The last remaining bit we would like to clarify and standardize with
this cleanup effort
is server runtime code referencing these legacy WildFly modules. It was
identified that WildFly server propagates:
* javax.api
* ibm.jdk
* sun.jdk
* org.jboss.vfs
modules to all deployments by default.
In order to standardize WildFly and EAP8 deployments we propose the
following changes:
* only java.se JPMS module will be propagated to all deployments by
default - was addressed with [6]
* deprecated ibm.jdk will not be propagated anymore to all deployments by
default - will be addressed with [7]
* deprecated sun.jdk will not be propagated anymore to all deployments by
default - will be addressed with [8]
* org.jboss.vfs will not be propagated to all deployments - was addressed
with [9]
This proposal of course introduces a potential (but fixable) backward
incompatibility issue between EAP7 and EAP8 deployments.
Deployments that were relying on sun.jdk module or org.jboss.vfs module to
be available in their deployments by default will need to be fixed
to reference org.jboss.vfs module or jdk. prefixed JPMS modules explicitly
- for example see [10].
Best regards,
JBoss Modules Team
[0]
https://en.wikipedia.org/wiki/Java_version_history - Java release dates
[1]
https://issues.redhat.com/browse/MODULES-254 - Support for dependency
on Jigsaw modules from static modules
[2]
https://issues.redhat.com/browse/WFCORE-3705 - Allow dependencies on
JDK modules
[3]
https://issues.redhat.com/browse/WFCORE-3684 - Upgrade JBoss Modules to
1.8.0.Final
[4]
https://issues.redhat.com/browse/WFCORE-6248 - Only Java SE aggregation
module should be visible to all deployments by default
[5]
https://openjdk.org/jeps/200 - JEP 200: The Modular JDK
[6]
https://issues.redhat.com/browse/WFCORE-6237 - Eliminate usage of
deprecated javax.api module
[7]
https://issues.redhat.com/browse/WFCORE-6245 - Eliminate usage of
deprecated ibm.jdk module
[8]
https://issues.redhat.com/browse/WFCORE-6249 - Eliminate usage of
deprecated sun.jdk module
[9]
https://issues.redhat.com/browse/WFCORE-6250 - Don't include
org.jboss.vfs module to all deployments by default
[10]
https://issues.redhat.com/browse/WFLY-17666 - Deployments using RMI
Java Naming provider must define explicit dependency on jdk.naming.rmi JPMS
module