asciidoctor / asciidoctorj-diagram

AsciidoctorJ Diagram bundles the Asciidoctor Diagram RubyGem (asciidoctor-diagram) so it can be loaded into the JVM using JRuby.
Apache License 2.0
10 stars 6 forks source link

NPE: graphvizVersion is null #56

Open hohwille opened 2 weeks ago

hohwille commented 2 weeks ago

I have tried asciidoctorj-diagram with your asciidoctor-diagram-example and that is working. However, now that I used it in a real world project, it fails with very strange errors:

I could render the stacktrace as SVG now and with some extra effort extract the error message as plain text:

An error has occured : java.lang.NullPointerException: Cannot invoke "net.sourceforge.plantuml.dot.GraphvizVersion.useShieldForQuantifier()" because "graphvizVersion" is null
This is the way

Diagram size: 43 lines / 1077 characters.

PlantUML (1.2024.5) cannot parse result from dot/GraphViz.

This version of PlantUML is 95 days old, so you should
consider upgrading from https://plantuml.com/download

Please go to https://plantuml.com/graphviz-dot to check your GraphViz version.

Java Runtime: OpenJDK Runtime Environment
JVM: OpenJDK 64-Bit Server VM
Default Encoding: UTF-8
Language: en
Country: US

PLANTUML_LIMIT_SIZE: 4096

This may be caused by :
- a bug in PlantUML
- a problem in GraphViz

You should send this diagram and this image to plantuml@gmail.com or
post to https://plantuml.com/qa to solve this issue.
You can try to turn around this issue by simplifing your diagram.

java.lang.NullPointerException: Cannot invoke "net.sourceforge.plantuml.dot.GraphvizVersion.useShieldForQuantifier()" because "graphvizVersion" is null
net.sourceforge.plantuml.svek.SvekLine.<init>(SvekLine.java:257)
net.sourceforge.plantuml.svek.GeneralImageBuilder.buildImage(GeneralImageBuilder.java:466)
net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFileInternal(CucaDiagramFileMakerSvek.java:135)
net.sourceforge.plantuml.svek.CucaDiagramFileMakerSvek.createFile(CucaDiagramFileMakerSvek.java:100)
net.atmp.CucaDiagram.exportDiagramInternal(CucaDiagram.java:463)
net.sourceforge.plantuml.classdiagram.ClassDiagram.exportDiagramInternal(ClassDiagram.java:114)
net.sourceforge.plantuml.UmlDiagram.exportDiagramNow(UmlDiagram.java:167)
net.sourceforge.plantuml.AbstractPSystem.exportDiagram(AbstractPSystem.java:236)
org.asciidoctor.diagram.plantuml.PlantUML.generate(PlantUML.java:182)
org.asciidoctor.diagram.LazyDiagramGenerator.generate(LazyDiagramGenerator.java:39)
org.asciidoctor.diagram.CommandProcessor.processRequest(CommandProcessor.java:40)
org.asciidoctor.diagram.CommandProcessor.processRequest(CommandProcessor.java:19)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base/java.lang.reflect.Method.invoke(Method.java:569)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:315)
org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:176)
org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:42)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:242)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:82)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:201)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:188)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:220)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:242)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:314)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:90)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:90)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.RubyMethod.call(RubyMethod.java:144)
org.jruby.RubyMethod$INVOKER$i$call.call(RubyMethod$INVOKER$i$call.gen)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:90)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:446)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:90)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:446)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:90)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:446)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:446)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:548)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:76)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:164)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:151)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:212)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:456)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:195)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:346)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:88)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:228)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:476)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:293)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:88)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:238)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:225)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:228)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:476)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:293)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:324)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:118)
org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:136)
org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:169)
org.jruby.runtime.BlockBody.yield(BlockBody.java:108)
org.jruby.runtime.Block.yield(Block.java:189)
org.jruby.RubyIO.ensureYieldClose(RubyIO.java:1203)
org.jruby.RubyIO.open(RubyIO.java:1197)
org.jruby.RubyIO$INVOKER$s$0$0$open.call(RubyIO$INVOKER$s$0$0$open.gen)
org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:446)
org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:92)
org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:103)
org.jruby.ir.instructions.CallBase.interpret(CallBase.java:545)
org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:363)
org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:66)
org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:128)
org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:115)
org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:194)
org.jruby.RubyClass.finvoke(RubyClass.java:810)
org.jruby.runtime.Helpers.invoke(Helpers.java:720)
org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:371)
org.asciidoctor.jruby.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:402)
org.asciidoctor.jruby.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:426)
org.asciidoctor.jruby.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:421)
org.asciidoctor.maven.AsciidoctorMojo.convertFile(AsciidoctorMojo.java:397)
org.asciidoctor.maven.AsciidoctorMojo.processSources(AsciidoctorMojo.java:255)
org.asciidoctor.maven.AsciidoctorMojo.processAllSources(AsciidoctorMojo.java:164)
org.asciidoctor.maven.AsciidoctorMojo.execute(AsciidoctorMojo.java:154)
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:126)
org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2(MojoExecutor.java:328)
org.apache.maven.lifecycle.internal.MojoExecutor.doExecute(MojoExecutor.java:316)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:174)
org.apache.maven.lifecycle.internal.MojoExecutor.access$000(MojoExecutor.java:75)
org.apache.maven.lifecycle.internal.MojoExecutor$1.run(MojoExecutor.java:162)
org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute(DefaultMojosExecutionStrategy.java:39)
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:159)
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:105)
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:73)
org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:53)
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:118)
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:261)
org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:173)
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:101)
org.apache.maven.cli.MavenCli.execute(MavenCli.java:906)
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:283)
org.apache.maven.cli.MavenCli.main(MavenCli.java:206)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.base/java.lang.reflect.Method.invoke(Method.java:569)
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:283)
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:226)
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:407)
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:348)

Also when I change the backend from html to pdf then the maven build fails with this error:

[ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:3.0.0:process-asciidoc (generate-pdf-doc) on project app-doc-arch: Execution generate-pdf-doc of goal org.asciidoctor:asciidoctor-maven-plugin:3.0.0:process-asciidoc failed: (LoadError) no such file to load -- asciidoctor-pdf -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:3.0.0:process-asciidoc (generate-pdf-doc) on project app-doc-arch: Execution generate-pdf-doc of goal org.asciidoctor:asciidoctor-maven-plugin:3.0.0:process-asciidoc failed: (LoadError) no such file to load -- asciidoctor-pdf
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:569)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate-pdf-doc of goal org.asciidoctor:asciidoctor-maven-plugin:3.0.0:process-asciidoc failed: (LoadError) no such file to load -- asciidoctor-pdf
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:133)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:906)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:569)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.jruby.exceptions.LoadError: (LoadError) no such file to load -- asciidoctor-pdf
    at org.jruby.RubyKernel.require (org/jruby/RubyKernel.java:1184)
    at uri_3a_classloader_3a_.META_minus_INF.jruby_dot_home.lib.ruby.stdlib.rubygems.core_ext.kernel_require.require (uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/rubygems/core_ext/kernel_require.rb:85)
    at RUBY.<main> (<script>:1)

I assume that this one is not related to asciidoctorj-diagram. If you want I can file it as a separate issue to asciidoctorj or asciidoctor-maven-plugin.

AsciiDoc and PlantUML are really awesome. However, if the toolchain is not working it kind of falls into pieces. When a maven plugin calls Ruby in Java that then executes an external programm (dot aka graphviz) it gets hard for me to trace down the error further. If there is anything more I can do to provide more debugging information, please let me know.

It would be awesome if you have any hints, workarounds or fixes for me. Thanks in advance for making asciidoctor and the diagram extension. I am also an active OSS developer on github and very much appreciate your work!

rpanzer-aviatrix commented 2 weeks ago

Please provide a repository to reproduce.

hohwille commented 2 weeks ago

Please provide a repository to reproduce.

Seriously for a NullPointerException where I provided the full stacktrace. Sounds like a hotline of an internet provider ;)

So here is as project that gives me the error as ZIP file: asciidoctorj-bug-56.zip

Next I expect is that you are telling me that it works on your end and will close the issue. ;)

Maybe my graphviz installation is not sane but some diagrams can be generated and others not... Maybe it is because I am using Windows and others are using Linux or Mac... I would love to get more help from your tool if my installation is probably not sane instead of getting a NullPointerException inside a diagram. I hope this still helps to get any further with my bug report. Thanks.

hohwille commented 2 weeks ago

Reinstalled Graphviz according to documentation and now getting this error in the image:

PlantUML version 1.2024.5 (Sun May 26 11:15:58 CEST 2024)Dot version: dot - graphviz version 2.44.1 (20200629.0846)Error: dot generates unreadable SVG file. Check you dot installation.

If I open this in IntelliJ it is just working. The maven plugin approach is however, very fragile.

robertpanzer commented 2 weeks ago

It works on OSX:

Bildschirmfoto 2024-09-02 um 15 05 19

Seriously for a NullPointerException where I provided the full stacktrace. Sounds like a hotline of an internet provider ;)

Your internet provider probably gets money for the service or non-service they provide. I am doing this without any compensation in my free time that I have to share with family, sleep, eat, ...

If anybody else wants to help, go ahead. I am out.

hohwille commented 2 weeks ago

Thanks for testing. I already assumed that something is wrong with the graphviz installation. I am however unable to figure out what or how to fix it. Since I followed the instructions from PlantUML, I have no clue what else to try.

Sorry, if my response sounded distracting. I am also an open-source developer and react to bugs in my code and also I report many bugs to other OSS projects and also consider my time for that valuable. Very often I get the answer that I need to provide a test project what also takes quite some time to isolate. In this case, I knew from the start that this will take me the time but the result, that you say that it is working. Exactly that happened. For me as a developer an NPE always speaks for itself, and I can at least do some initial investigation and most likely a fix without further information...

Some more constructive thoughts: