Illegal reflective access by net.sourceforge.plantuml.svg.SvgGraphics

0 votes
asked Jan 13 in Bug by Marc-vA (240 points)

When using the local VSCode extension for generating an SVG from a model I get the following error message:

Error found in diagram LandAdministrationDomainModel
WARNING: An illegal reflective access operation has occurred 
WARNING: Illegal reflective access by net.sourceforge.plantuml.svg.SvgGraphics (file:/C:/Users/<myUserName>/.vscode/extensions/jebbs.plantuml-2.13.6/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'm running AdoptOpenJDK 11.0.4 on Windows 10.

As a Java developer this seems to me that SvgGraphics is using an internal JRE class, com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl in this case, which is not allowed. In previous Java Runtimes (before Java 9) this could not be detected and prohibited ... but as of Java 9 (with Project Jigsaw) this has become possible and for a reason. It is bad practice to use internal JRE classes instead of the interfaces. They might change without notice from one version to another. Apparently it still works and the PlantUML code is using XSLT from the Xalan package from the JRE. Possible solution might be changing this to (a newer version of) Apache Xalan directly as a dependency instead of using it from the JRE?

commented Feb 2 by anonymous
I have the same experience and even though it works for now I would appreciate a fix!

2 Answers

0 votes
answered Jan 25 by anonymous
+1 , experienced the same issue here, hope this will be adressed
0 votes
answered Feb 2 by plantuml (214,040 points)
We've just built a new beta version http://beta.plantuml.net/plantuml.jar

This version is not using xalan by default, so it should be fixed now.

Could you test it and tell us if it's better for you ?

Thanks!
commented Feb 3 by Marc-vA (240 points)
Replacing the original JAR in the jebbs.plantuml extension plugin in VSCode with the provided beta JAR above at least removes the error in VSCode generating images from .puml files. Seems to work like a charm!

I don't have an extensive testing set up ready so I just tested with my current diagrams. These all work.

Thank you for your work and responding to this issue!!
...