-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java 9: Illegal reflective access by com.sun.xml.bind.v2.runtime.reflect.opt.Injector #1197
Comments
@namannigam Commented |
@bravehorsie Commented This legacy optimization is removed completely in jaxb-ri master (after To disable this optimization for 2.3.0, set system property Roman On Wed, May 9, 2018 at 6:57 AM, Naman Nigam [email protected]
|
@corneliuc Commented 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 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 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, 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 Library used: Corneliu, |
@bravehorsie Commented as I posted here: Roman On Fri, May 18, 2018 at 12:02 PM, corneliuc [email protected]
|
@abdulmuqsith Commented |
|
Fixed in 2.3.1 |
Requires a version of pride-xml-handling that depends on jaxb-xjc 2.3.1 or newer See: eclipse-ee4j/jaxb-ri#1197 javaee/jaxb-v2@9805bc9 https://www.jesperdj.com/2018/09/30/jaxb-on-java-9-10-11-and-beyond/ https://github.com/javaee/jaxb-v2/blob/master/README.md https://javaee.github.io/jaxb-v2/doc/user-guide/ch03.html#deployment-maven-coordinates
Fix issue: eclipse-ee4j/jaxb-ri#1197
Hi I'm using |
Hi, I tested my jaxb application (compiled with JDK8) with JDK 16 (openjdk) and it fails with the exception:
I upgrade to the lastest JAXB 2.3 release (no 2.4 release yet) as I need wide java version compatibility (8 to 17). To fix the problem with JDK16, I must explicitely set one of the following system properties before calling JAXBContext.newInstance(...):
Which property is better to use ? Would it be possible to detect JDK16 in jaxb 2.3.x or 2.4 (JDK8 compatible) and disable such (unsupported) optimization ? Here are my concrete maven (explicit) dependencies to use JAXB 2.3.3 in my project:
|
Does passing |
In my case, the application is build on JDK8 (to be sure it works on java 8) as a single fat jar or exploded classpath. As I am not using modules yet, I have no idea. Moreover, it is a desktop application so I can not ask users to define magic flags on the command line, but I can set few needed system properties in my code:
|
So this the cause of your troubles and reason I won't be able to reproduce the issue on my end. Your app needs to have |
Thanks. |
With Java 9 or 10, using
results in:
The text was updated successfully, but these errors were encountered: