Closed barthel closed 4 years ago
I suspect this and https://github.com/asciidoctor/asciidoctor-maven-plugin/issues/402 are related.
Can you try the new 2.0.0 versions. Note that extensions may require changes (see the official migration guide).
Can you try using the latest versions: asciidoctorj: 2.0.0 asciidoctor-maven-plugin: 2.0.0-RC.1 jruby-complete: 9.2.7.0 asciidoctorj-pdf: 1.5.0-alpha.17
I've tried the versions like above.
The StringIndexOutOfBoundsException
is fixed with the new extension release(see comment of @jagedn in #402).
But now I've a Ruby error:
Apr 28, 2019 10:15:02 AM org.asciidoctor.jruby.internal.JRubyAsciidoctor convertFile
SEVERE: (TypeError) cannot convert instance of class org.jruby.gen.RubyObject67 to class java.lang.String
[...]
[ERROR] Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc (generate-XXXXXXXXXX.pdf) on project taco.doc: Execution generate-XXXXXXXXXX.pdf of goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc failed: org.jruby.exceptions.TypeError: (TypeError) cannot convert instance of class org.jruby.gen.RubyObject67 to class java.lang.String -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc (generate-XXXXXXXXXX.pdf) on project taco.doc: Execution generate-XXXXXXXXXX.pdf of goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc failed: org.jruby.exceptions.TypeError: (TypeError) cannot convert instance of class org.jruby.gen.RubyObject67 to class java.lang.String
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution generate-XXXXXXXXXX.pdf of goal org.asciidoctor:asciidoctor-maven-plugin:2.0.0-RC.1:process-asciidoc failed: org.jruby.exceptions.TypeError: (TypeError) cannot convert instance of class org.jruby.gen.RubyObject67 to class java.lang.String
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.asciidoctor.jruby.internal.AsciidoctorCoreException: org.jruby.exceptions.TypeError: (TypeError) cannot convert instance of class org.jruby.gen.RubyObject67 to class java.lang.String
at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convertFile (JRubyAsciidoctor.java:378)
at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convertFile (JRubyAsciidoctor.java:349)
at org.asciidoctor.maven.AsciidoctorMojo.renderFile (AsciidoctorMojo.java:476)
at org.asciidoctor.maven.AsciidoctorMojo.execute (AsciidoctorMojo.java:260)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.jruby.exceptions.TypeError: (TypeError) cannot convert instance of class org.jruby.gen.RubyObject67 to class java.lang.String
at org.asciidoctor.jruby.extension.processorproxies.PostprocessorProxy.process (org/asciidoctor/jruby/extension/processorproxies/PostprocessorProxy.java:98)
at org.jruby.RubyMethod.call (org/jruby/RubyMethod.java:124)
at RUBY.convert (uri:classloader:/gems/asciidoctor-2.0.2/lib/asciidoctor/document.rb:950)
at org.jruby.RubyArray.each (org/jruby/RubyArray.java:1792)
at RUBY.convert (uri:classloader:/gems/asciidoctor-2.0.2/lib/asciidoctor/document.rb:949)
at RUBY.convert (uri:classloader:/gems/asciidoctor-2.0.2/lib/asciidoctor.rb:1450)
at RUBY.convert_file (uri:classloader:/gems/asciidoctor-2.0.2/lib/asciidoctor.rb:1518)
at org.jruby.RubyIO.open (org/jruby/RubyIO.java:1157)
at RUBY.convert_file (uri:classloader:/gems/asciidoctor-2.0.2/lib/asciidoctor.rb:1518)
[ERROR]
[...]
It seems this is a problem with the extension too? If so, the error message should be more understandable.
at RUBY.convert_file (uri:classloader:/gems/asciidoctor-2.0.2/lib/asciidoctor.rb:1518)
This is weird, Asciidoctorj 2.0.0 comes with asciidoctor gem 2.0.8. Something may be polluting the classpath.
If this is different from #402, can I ask also for an example or at least the pull pom?
Same error here. It happens multiple times during the build, but does not stop it.
Versions:
<asciidoctor.maven.plugin.version>2.0.0-RC.1</asciidoctor.maven.plugin.version>
<asciidoctorj.version>2.0.0</asciidoctorj.version>
<asciidoctorj.pdf.version>1.5.0-alpha.17</asciidoctorj.pdf.version>
<jruby.version>9.2.7.0</jruby.version>
mai 20, 2019 2:15:08 PM org.asciidoctor.jruby.internal.JRubyAsciidoctor log AVERTISSEMENT: Unexpected exception while logging Asciidoctor log entry java.lang.StringIndexOutOfBoundsException: String index out of range: -8 at java.lang.String.substring(String.java:1931) at org.asciidoctor.maven.log.LogRecordHelper.format(LogRecordHelper.java:44) at org.asciidoctor.maven.log.MemoryLogHandler.log(MemoryLogHandler.java:34) at org.asciidoctor.jruby.internal.JRubyAsciidoctor.log(JRubyAsciidoctor.java:474) at org.asciidoctor.jruby.log.internal.JavaLogger.log(JavaLogger.java:157) at org.asciidoctor.jruby.log.internal.JavaLogger.warn(JavaLogger.java:116) at org.asciidoctor.jruby.log.internal.JavaLogger$INVOKER$i$0$2$warn.call(JavaLogger$INVOKER$i$0$2$warn.gen) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:200) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168) at uri_3a_classloader3a.gems.asciidoctor_minus_2_dot_0_dot_8.lib.asciidoctor.parser.invokeOther78:warn(uri:classloader:/gems/asciidoctor-2.0.8/lib/asciidoctor/parser.rb:359) at uri_3a_classloader3a.gems.asciidoctor_minus_2_dot_0_dot_8.lib.asciidoctor.parser.RUBY$method$next_section$0(uri:classloader:/gems/asciidoctor-2.0.8/lib/asciidoctor/parser.rb:359) at org.jruby.internal.runtime.methods.CompiledIRMethod.call(CompiledIRMethod.java:91) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:90) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:80) at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:540) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:296) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:82) at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:540) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:296) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:82) at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:540) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:80) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:138) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:125) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:192) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:318) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:139) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:346) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:204) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:191) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:360) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:201) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) at org.jruby.ir.interpreter.InterpreterEngine.interpret(InterpreterEngine.java:92) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:204) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:191) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:360) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:201) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:326) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) at org.jruby.ir.interpreter.Interpreter.INTERPRET_BLOCK(Interpreter.java:128) at org.jruby.runtime.MixedModeIRBlockBody.commonYieldPath(MixedModeIRBlockBody.java:151) at org.jruby.runtime.IRBlockBody.doYield(IRBlockBody.java:187) at org.jruby.runtime.BlockBody.yield(BlockBody.java:116) at org.jruby.runtime.Block.yield(Block.java:165) at org.jruby.RubyIO.ensureYieldClose(RubyIO.java:1163) at org.jruby.RubyIO.open(RubyIO.java:1157) at org.jruby.RubyIO$INVOKER$s$0$0$open.call(RubyIO$INVOKER$s$0$0$open.gen) at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:296) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:82) at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:89) at org.jruby.ir.instructions.CallBase.interpret(CallBase.java:537) at org.jruby.ir.interpreter.InterpreterEngine.processCall(InterpreterEngine.java:362) at org.jruby.ir.interpreter.StartupInterpreterEngine.interpret(StartupInterpreterEngine.java:72) at org.jruby.internal.runtime.methods.MixedModeIRMethod.INTERPRET_METHOD(MixedModeIRMethod.java:105) at org.jruby.internal.runtime.methods.MixedModeIRMethod.call(MixedModeIRMethod.java:92) at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:174) at org.jruby.RubyClass.finvoke(RubyClass.java:788) at org.jruby.runtime.Helpers.invoke(Helpers.java:449) at org.jruby.RubyBasicObject.callMethod(RubyBasicObject.java:376) at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:369) at org.asciidoctor.jruby.internal.JRubyAsciidoctor.convertFile(JRubyAsciidoctor.java:350) at org.asciidoctor.maven.AsciidoctorMojo.renderFile(AsciidoctorMojo.java:476) at org.asciidoctor.maven.AsciidoctorMojo.execute(AsciidoctorMojo.java:260) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:954) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Can you share the document you are converting? It will help a lot. Thing is, it seems ome messages have some special structure not covered by the current parser, so I need to identify the specific case to be able to deal with it.
Here is the doc in attachment. Thx!
I am unable to reproduce with a custom maven-to-pdf project and I am really puzzled here.
The error seems caused because sourceDirectory.getCanonicalPath().length()
returns -9... https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/880938df1c638aaabedb3c944cd3e0ea1844109e/src/main/java/org/asciidoctor/maven/log/LogRecordHelper.java#L44
This is just guessing, but can you answer this plis:
sourceDirectory
property in the pom?If this doesn't bring anything, I can publish a pre-release with some good old extra logs to see what's going on. Would you be wiling to run it and come back with the logs?
Ok with the pre-release but not sure I'd know how to use it. I'd give it my best effort.
First, thanks for your time and sorry in advance, I wrote a pretty secure code but it may be we need to go through a couple iterations.
To run the pre-release follow these steps:
<repositories>
<repository>
<id>bintray-asciidoctor-maven-asciidoctor-maven-plugin</id>
<name>asciidoctor-maven-asciidoctor-maven-plugin</name>
<url>https://dl.bintray.com/abelsromero/maven/</url>
</repository>
</repositories>
<groupId>org.asciidoctor</groupId>
<artifactId>asciidoctor-maven-plugin</artifactId>
<version>2.0.0.RC.logging.1</version>
Once is done, send me the output from the console. Note that file paths willl appear in the logs, so if there's anything sensible or you just don't want to show here, ping me on twitter for a private channel
Log handling have been reworked and tested in last 2.0.0 version. If the issue persist, please re-open.
This error is shown after update from: