JDK-8177677 : jaxb-impl reference to internal API's
  • Type: Bug
  • Component: xml
  • Sub-Component: jaxb
  • Priority: P2
  • Status: Resolved
  • Resolution: Won't Fix
  • Submitted: 2017-03-27
  • Updated: 2017-04-03
  • Resolved: 2017-04-03
Related Reports
Relates :  
Description
Running WebLogic Server build on JDK9 b162 with --permit-illegal-access generates the following jaxb-impl related output.

WARNING: Illegal access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:gradle_cache/caches/modules-2/files-2.
1/com.sun.xml.bind/jaxb-impl/2.3.0-b170202.1032/42b17482fdb603e425cf474e8d8e3e7fb3c7dbb3/jaxb-impl-2.3.0-b170202.1032.ja
r) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Illegal access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:gradle_cache/caches/modules-2/files-2.
1/com.sun.xml.bind/jaxb-impl/2.3.0-b170202.1032/42b17482fdb603e425cf474e8d8e3e7fb3c7dbb3/jaxb-impl-2.3.0-b170202.1032.ja
r) to method java.lang.ClassLoader.findLoadedClass(java.lang.String)
WARNING: Illegal access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:gradle_cache/caches/modules-2/files-2.
1/com.sun.xml.bind/jaxb-impl/2.3.0-b170202.1032/42b17482fdb603e425cf474e8d8e3e7fb3c7dbb3/jaxb-impl-2.3.0-b170202.1032.ja
r) to method java.lang.ClassLoader.resolveClass(java.lang.Class)

Comments
in JDK-8170371, the fallback to Unsafe has been added; original code is still there since the implementation should work on jdk pre-9 as well (and preferably with no changes)
03-04-2017

Related to https://bugs.openjdk.java.net/browse/JDK-8170371
31-03-2017

This appears to be the standalone version of JAXB rather than the version in the JDK (in the JDK then this code is in com.sun.xml.internal.bind.v2.runtime). In any case, I think the issue here is that the JAXB attempts to hack into ClassLoader.defineClass and if that fails then it falls back to Unsafe. That would explain the warnings.
27-03-2017