Open zenbones opened 1 month ago
I get this error in ubuntu 22.04, openjdk 17, but not in windows with graalvm 17, if that helps...
...but I see the same 2.5.7.
Can you clarify this comment? mvn dependency:tree
should show if there's some other version in runtime...even though I thought Maven would pull the latest is set in the pom.
btw, AsciidoctorJ 3.0.0 uses asciidoctor v2.0.23, at least we know that version is in the classpath
What I mean is that I get that error under openjdk17 on ubuntu 22.04 with only 2.5.7 on the classpath, or only 3.0.0 on the classpath, but not both at the same time. I can guarantee the classpath because all of our jars are pulled and collected into a lib directory that serves as the classpath for tanukisoft scripts that are hosting the jvm, and all versions are fully sepcified in maven poms, and I have checked both the jars available to my local IDE (intelij), and the jars packed into the tanukisoft distribution, and they are both clean, either 2.5.7 or 3.0.0.
Here's the relevant bit from the lib directory...
apiguardian-api-1.1.2.jar artifact-maven-6.0.0-SNAPSHOT.jar asciidoctorj-3.0.0.jar asciidoctorj-api-3.0.0.jar asm-9.7.jar asm-analysis-9.7.jar
..and the only asciidoctor jars are both 3.0.0. I would obviously prefer to resolve this issue with 3.0.0.
What I'm really asking is what the mechanism is that would cause that error. My ability to debug easily ends with...
org.jruby.RubyClass.new(org/jruby/RubyClass.java:922
...and the code there is a dynamic reference into some ruby code, I think... I have no clue how to go further. Is there a file in the asciidoctor jars I can double check? A line of code that should have some signature? Or some piece of java being loaded as a service?
I also checked the maven repository on the tanukisoft-based install where I get the error, and it's empty except for a few of our jars containing classpath available text templates. Nothing else in it, so the only asciidocj code on the machine is the 3.0.0 jars listed above. Just as proof maven isn't downloading other versions somehow and confusing the classpath.
It would be great if you could provide a reproducer. It might make sense checking what JRuby jars are used.
I'd like to hand you a reproducer, but I develop on windows, where I can't get a reproduction. Everything works fine. In ubuntu 24.04 I can reproduce in 2.5.7 0r 3.0.0. If I change the asciidoctorj version in my maven pom to 2.5.2 then the problem goes away in linux as well. With 3.0.0 it pulls jruby 9.4.8.0, which is not surprising as that's the listed dependency. With 2.5.2 it's jruby 9.2.17.0.
I'll try to put together a reproducer in linux and see. The document we feed to asciidoctorj is dynamically constructed, so i's a bit difficult, but I'll see what I can do, maybe capture it and create something small and runnable.
The import is...
...but I see the same 2.5.7.
The code is...
...and I now get...