This rule flags the use of the com.sun.xml.internal.bind.v2.ContextFactory class. This
internal class is no longer available in Java SE 11. These packages are internal and are not intended for
external use. However, if the application must continue using this class,
a possible solution is to instead use the com.sun.xml.bind.v2.ContextFactory class and
package the required jaxb dependency libraries in the application. The following
is a sample of the maven dependency file to pull in the required library to
use the com.sun.xml.bind.v2.ContextFactory class:
| <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId> <version>2.2.11</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <version>2.2.11</version> </dependency> |
A quick fix is available in the source scanner to replace references to
com.sun.xml.internal.bind.v2.ContextFactory into com.sun.xml.bind.v2.ContextFactory.
For more information on the Java 11 changes, see The Java 11 Migration Guide. For more information the removal of the com.sun.xml.bind directory, see the JEP entry for the Removal of the Java EE and CORBA Modules.