Skip to content
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

NPE: graphvizVersion is null #56

Open
hohwille opened this issue Aug 30, 2024 · 6 comments
Open

NPE: graphvizVersion is null #56

hohwille opened this issue Aug 30, 2024 · 6 comments

Comments

@hohwille
Copy link

hohwille commented Aug 30, 2024

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:

  • first diagram is rendered fine (simple sequence diagram)
  • second diagram is rendered with a stracktrace of an error
  • all further diagrams are not rendered as images but in the resulting document they all point to the first diagram instead of the PUML image that is actually included here
  • as you could already guess the actual maven buils is successful and I get an HTML generated from the AsciiDoc with the effects described above.

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 [email protected] 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
Copy link

Please provide a repository to reproduce.

@hohwille
Copy link
Author

hohwille commented Sep 2, 2024

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
Copy link
Author

hohwille commented Sep 2, 2024

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
Copy link
Member

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
Copy link
Author

hohwille commented Sep 2, 2024

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:

@jakubcheu
Copy link

Hello @hohwille
Kind of workaround, but I got rid of similar NPE just by switching PlantUML's layout engine to other than default.

I included following line:

!pragma layout smetana

...at the begining of my diagram's code, right below @startuml. After that, the actual diagram was rendered correctly instead of the long, nasty stacktrace.

You may give it a try with your diagrams.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants