Getting "An illegal reflective access operation has occurred" with AdoptOpenJDK 12

0 votes
asked Apr 3, 2019 in Bug by syrdbaw4 (140 points)
I recently upgraded from OpenJDK 11 (java-11-openjdk-11.0.2.7-1.windows.ojdkbuild.x86_64.msi) to AdoptOpenJDK 12 (OpenJDK12U-jdk_x64_windows_hotspot_12_33.msi) in order to attempt to workaround some other runtime glitches.

After doing this, I started getting the following warnings:

Error found in diagram DashStructure
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sourceforge.plantuml.svg.SvgGraphics (file:/C:/Users/saares/Google%20Drive/Tools/plantuml.jar) to constructor com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl()
WARNING: Please consider reporting this to the maintainers of net.sourceforge.plantuml.svg.SvgGraphics
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

I am unable to reproduce this from the command line at the moment - this is from the Visual Studio Code plugin - but I thought I would post this anyway in case this is some known issue or something new that deserves attention.

3 Answers

0 votes
answered May 17, 2019 by Stephan
I also get this messsage when using the command line to ouput plantUML to SVG.
I.e. java -jar plantuml.jar -tsvg sequenceDiagram.txt
I'm using Oracles Java 12.0.1 on a Mac.
Your's
commented Jul 16, 2019 by nemonik
Me too when using brew installed adoptopenjdk12.
0 votes
answered Oct 7, 2019 by Chad

The message is a part of a warnings for future java module improvements. I was able to disable them on OpenJDK 13 on MacOS using PlantUML jar file "plantuml.1.2019.11.jar"

I added the following command line option to java. 

--add-opens java.xml/com.sun.org.apache.xalan.internal.xsltc.trax=ALL-UNNAMED"

commented Nov 6, 2019 by markhh
I see this warning on OpenJDK 13 as well in Arch Linux.

Your workaround didn't work for me. I get the warning:

WARNING: package com.sun.org.apache.xalan.internal.xsltc.trx not in java.xml
0 votes
answered Jan 13, 2020 by Marc-vA (240 points)

I don't think it should be 'solved' by suppressing the warning ... because it is a valid warning wink

I opened a new bug for this with the attention of the illegal access on a JRE internal class

Shall we close this issue and continue the solution in https://forum.plantuml.net/10650/illegal-reflective-access-sourceforge-plantuml-svggraphics?

...