Skip to content

PlantUml Plugin 8.12.1 - GraphViz und ImageIO Problems #1302

@mncod1ng

Description

@mncod1ng

Hi,

I observed some issues related to the PlantUml Plugin 8.12.1 and how System Variables are evaluated when running the gradle task.
I am a Windows user.

First issue: Graphviz dlls are not found

java.io.FileNotFoundException: C:\WINDOWS_graphviz\cdt.dll (Das System kann den angegebenen Pfad nicht finden)
at java.base/java.io.FileOutputStream.open0(Native Method)
at java.base/java.io.FileOutputStream.open(FileOutputStream.java:293)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:235)
at java.base/java.io.FileOutputStream.(FileOutputStream.java:184)
at net.sourceforge.plantuml.windowsdot.WindowsDotArchive.extract(WindowsDotArchive.java:103)
at net.sourceforge.plantuml.windowsdot.WindowsDotArchive.getWindowsExeLite(WindowsDotArchive.java:129)
at net.sourceforge.plantuml.dot.GraphvizWindowsLite.specificDotExe(GraphvizWindowsLite.java:57)
at net.sourceforge.plantuml.dot.AbstractGraphviz.searchDotExe(AbstractGraphviz.java:90)
at net.sourceforge.plantuml.dot.AbstractGraphviz.(AbstractGraphviz.java:75)
at net.sourceforge.plantuml.dot.GraphvizWindowsLite.(GraphvizWindowsLite.java:68)
at net.sourceforge.plantuml.dot.GraphvizUtils.create(GraphvizUtils.java:109)
at net.sourceforge.plantuml.svek.DotStringFactory.getGraphvizVersionInternal(DotStringFactory.java:271)
at net.sourceforge.plantuml.svek.DotStringFactory.getGraphvizVersion(DotStringFactory.java:265)
at net.sourceforge.plantuml.svek.GraphvizImageBuilder.printEntityInternal(GraphvizImageBuilder.java:380)
at net.sourceforge.plantuml.svek.GraphvizImageBuilder.printEntity(GraphvizImageBuilder.java:362)
at net.sourceforge.plantuml.svek.GraphvizImageBuilder.printEntities(GraphvizImageBuilder.java:354)
at net.sourceforge.plantuml.svek.GraphvizImageBuilder.buildImage(GraphvizImageBuilder.java:224)
at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(CucaDiagramFileMakerSvek.java:103)
at net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(CucaDiagramFileMakerSvek.java:69)
at net.atmp.CucaDiagram.exportDiagramInternal(CucaDiagram.java:475)
at net.sourceforge.plantuml.classdiagram.ClassDiagram.exportDiagramInternal(ClassDiagram.java:83)
at net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:139)
at net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:210)
at net.sourceforge.plantuml.PSystemUtils.exportDiagramsDefault(PSystemUtils.java:207)
at net.sourceforge.plantuml.PSystemUtils.exportDiagrams(PSystemUtils.java:96)
at net.sourceforge.plantuml.SourceFileReaderAbstract.getGeneratedImages(SourceFileReaderAbstract.java:190)
at io.freefair.gradle.plugins.plantuml.PlantumlAction.execute(PlantumlAction.java:34)

Interpretation:

  • It seems that GRAPHVIZ_DOT (which is used in PlantUml to search for the Graphviz dot.exe) cannot be set in the build.gradle. Therefore it defaults to {java.io.tmpdir}_graphviz in src/net/sourceforge/plantuml/windowsdot/WindowsDotArchive.java. But for some reason java.io.tmpdir is not what System.getProperty("java.io.tmpdir") returns in my gradle.build but C:\WINDOWS

I found an ugly workaround:
1.1) As a workaround I added the required folder in C:\WINDOWS and added the missing dlls available from the newest GraphViz Zip Archive.
1.2) I also needed to add an expat.dll. It was not included in the GraphViz Zip Archive and I got it from https://github.com/ErwinJanssen/graphviz-windows-dependencies.

Second issue: But even after fixing these issues by my workaround I still have the following problem:

Caused by: java.nio.file.AccessDeniedException: C:\WINDOWS\imageio16452219325278130177.tmp
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:236)
at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
at java.base/java.nio.file.Files.createFile(Files.java:658)
at java.base/java.nio.file.TempFileHelper.create(TempFileHelper.java:136)
at java.base/java.nio.file.TempFileHelper.createTempFile(TempFileHelper.java:159)
at java.base/java.nio.file.Files.createTempFile(Files.java:923)
at java.desktop/javax.imageio.stream.FileCacheImageInputStream.(FileCacheImageInputStream.java:102)
at java.desktop/com.sun.imageio.spi.InputStreamImageInputStreamSpi.createInputStreamInstance(InputStreamImageInputStreamSpi.java:69)
at java.desktop/javax.imageio.ImageIO.createImageInputStream(ImageIO.java:359)
... 41 more

Task :plantUml FAILED

Execution failed for task ':plantUml'.

Multiple task action failures occurred:
A failure occurred while executing io.freefair.gradle.plugins.plantuml.PlantumlAction

Interpretation:

  • It seems that ImageIO Default Cache is null. There TempFileHelper uses then java.io.tmpdir as well which again is C:\WINDOWS.

Conclusions:

  • Both issues seem to be caused by System Variables not correctly used. My Windows System Variables are different from the values I see when the gradle task is executed. I am not able to set the variables in build.gradle.

If you have some advice or can fix the bug, I would be glad. Thanks alot.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions