Skip to content
This repository has been archived by the owner on Feb 5, 2019. It is now read-only.

Java 9: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector #1197

Open
plutext opened this issue May 6, 2018 · 5 comments

Comments

@plutext
Copy link

plutext commented May 6, 2018

With 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
@namannigam-zz
Copy link

Tracker for a similar question on Stackoverflow => Q50237516

@bravehorsie
Copy link
Member

bravehorsie commented May 9, 2018 via email

@corneliuc
Copy link

Hi Roman,

When I try to run with Java 9 I have the following behavior:

java -XX:+IgnoreUnrecognizedVMOptions --add-modules java.activation -cp ":./otherJars/" com.package.Main "$@"

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector (file:/.../jaxb-impl.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

And when I used noOptimize I still have some messages:

java -XX:+IgnoreUnrecognizedVMOptions -Dcom.sun.xml.bind.v2.bytecode.ClassTailor.noOptimize=true --add-modules java.activation -cp ":./otherJars/" com.package.Main "$@"

May 18, 2018 12:18:52 PM com.sun.xml.bind.v2.runtime.reflect.opt.AccessorInjector
INFO: The optimized code generation is disabled

Do you know how to escape these messages?

The current intent for Oracle is to remove the java.se.ee modules starting with a future release which apparently is Java 11,
this means we will not be able to use anymore JAXB(javax.xml.bind module).

How I can be procced further I need to change the library completely already now(find a replacement for JAXB) in order to be compatible with Java 11+ or use JAXB for Java 9 and 10 and look in the future
for Java 11 solution, keep in mind java 11 will be released soon(around the end of this year).
https://jaxenter.com/jdk-11-java-ee-modules-140674.html

Library used:
FastInfoset-1.2.13.jar
istack-commons-runtime-3.0.5.jar
stax-ex-1.7.8.jar
txw2-2.3.0.jar
jaxb-api-2.3.0.jar
jaxb-core-2.3.0.jar
jaxb-runtime-2.3.0.jar

Corneliu,

@bravehorsie
Copy link
Member

bravehorsie commented May 18, 2018 via email

@abdulmuqsith
Copy link

When do we have the next release 2.4 available?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants