Java 9: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector
See original GitHub issueWith Java 9 or 10, using
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.0</version>
</dependency>
results in:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector
(file: repository/org/glassfish/jaxb/jaxb-runtime/2.3.0/jaxb-runtime-2.3.0.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int)
WARNING: Please consider reporting this to the maintainers of com.sun.xml.bind.v2.runtime.reflect.opt.Injector
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Proper fix for Java 10 complaining about illegal reflection ...
Apparently this is not the correct fix. WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.
Read more >Java 9: Illegal reflective access by com.sun.xml.bind.v2 ...
WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.
Read more >Java 9 Illegal Reflective Access Warning - Baeldung
In this tutorial, we'll inspect the relationship between the module system and reflection. 2. Modular System and Reflection.
Read more >WARNING: Illegal reflective access by com.sun.xml.bind.v2 ...
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector on JDK 9. Status: Assignee: Priority: Resolution:.
Read more >Illegal reflective access with createFromXmlResource()
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/C:/blah.jar) to method java.lang.ClassLoader.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bravehorsie Commented jaxb-ri runtime uses
ClassLoader#defineClass / Unsafe#defineClass
to do some bytecode modification in runtime to optimize performance.ClassLoader#defineClass
is tried first which causes the warning.This legacy optimization is removed completely in jaxb-ri master (after 2.3.0, not released yet).
To disable this optimization for 2.3.0, set system property
com.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize
.Roman
On Wed, May 9, 2018 at 6:57 AM, Naman Nigam notifications@github.com wrote:
Thanks. My fat jar already had META-INF/versions folder but ‘Multi-Release: true’ was missing in the MANIFEST.MF ! I will get rid of my JDK16 fix as it works now like a charm !