gpt4 book ai didi

grails - 具有显式jruby依赖关系的AsciidoctorJ导致IncompatibleClassChangeError

转载 作者:行者123 更新时间:2023-12-02 16:00:48 30 4
gpt4 key购买 nike

我遵循一些有用的建议(https://github.com/asciidoctor/asciidoctorj/issues/313#issuecomment-119372587),通过添加对jruby的显式依赖关系来使asciidoctorJ在我的开发环境中工作:

compile 'org.jruby:jruby:9.0.0.0.rc1'
compile 'org.asciidoctor:asciidoctorj:1.5.2'

但是,当我将代码推送到我们的质量检查环境时,我现在收到以下消息:
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.objectweb.asm.FieldVisitor, but class was expected
at org.jruby.java.codegen.RealClassGenerator.defineOldStyleImplClass(RealClassGenerator.java:104)
at org.jruby.java.codegen.RealClassGenerator.createOldStyleImplClass(RealClassGenerator.java:63)
at org.jruby.javasupport.Java.newInterfaceImpl(Java.java:1183)
at org.jruby.java.proxies.JavaInterfaceTemplate.jcreateProxy(JavaInterfaceTemplate.java:281)
at org.jruby.java.proxies.JavaInterfaceTemplate.access$000(JavaInterfaceTemplate.java:30)
at org.jruby.java.proxies.JavaInterfaceTemplate$4.call(JavaInterfaceTemplate.java:181)
at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:661)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:198)
at org.jruby.RubyClass.finvoke(RubyClass.java:624)
at org.jruby.runtime.Helpers.invoke(Helpers.java:500)
at org.jruby.javasupport.JavaUtil.convertProcToInterface(JavaUtil.java:248)
at org.jruby.RubyBasicObject.toJava(RubyBasicObject.java:800)
at org.jruby.javasupport.JavaEmbedUtils.rubyToJava(JavaEmbedUtils.java:273)
at org.asciidoctor.internal.RubyUtils.rubyToJava(RubyUtils.java:18)
at org.asciidoctor.internal.JRubyAsciidoctorModuleFactory.createAsciidoctorModule(JRubyAsciidoctorModuleFactory.java:27)
at org.asciidoctor.internal.JRubyAsciidoctor.createJRubyAsciidoctorInstance(JRubyAsciidoctor.java:123)
at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:62)
at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:647)

基于研究,我相信我遇到了ASM不兼容的问题,但是我担心我的代码库/依赖项没有足够孤立,无法获得可复制的构建。对于可以采取哪些步骤来确保构建可跨环境工作的建议,我将不胜感激。

最佳答案

进一步的研究使我发现这是Grails插件和jruby依赖之间的(愚蠢)依赖问题。 Grails包含了asm-3.3.1作为grails-test-plugin的依赖项。我尝试为插件设置export = false,但努力使它起作用。我的最终解决方案是添加
grails.war.resources = { stagingDir, args ->
delete {
fileset(file: "${stagingDir}/WEB-INF/lib/asm-3.3.*.jar")
}
}

到我们的BuildConfig.groovy。这使我们摆脱了asm依赖冲突。

关于grails - 具有显式jruby依赖关系的AsciidoctorJ导致IncompatibleClassChangeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31304135/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com