解决错误java.lang.NoSuchMethodError:org.codehaus.groovy.ast.ModuleNode.getStarImports()Ljava / util / List; [英] Solve Error java.lang.NoSuchMethodError: org.codehaus.groovy.ast.ModuleNode.getStarImports()Ljava/util/List;
问题描述
异常:java.lang.NoSuchMethodError:org.codehaus.groovy.ast.ModuleNode .getStarImports()Ljava / util的/列表;
我尝试过groovy 1.8.4,groovy 1.8.6等各种版本的groovy jar。但是我无法摆脱这个错误。
当我在同一时间在类路径中有两个不同版本的Groovy时,发生了这种情况。检查你的类路径,特别是使用混淆它的东西,例如Eclipse或Maven。
在我的具体情况中,我试图使用Groovy 1.8.6,但Maven依赖项是在1.6.5中拖动导致错误。它在命令行上正常运行单元测试,但不能在Eclipse中运行。
I am encountering this exception.
Exception :java.lang.NoSuchMethodError: org.codehaus.groovy.ast.ModuleNode.getStarImports()Ljava/util/List;
I have tried various version of groovy jars like groovy 1.8.4, groovy 1.8.6 etc. But I am not able to get rid of this error.
This happened to me when I had 2 different versions of Groovy in the classpath at the same time. Check your classpath especially if using something that obfuscates it such as Eclipse or Maven.
In my specific case, I was trying to use Groovy 1.8.6 but a Maven dependency was dragging in 1.6.5 causing errors. It worked fine running unit tests on the command line, but not from within Eclipse.
这篇关于解决错误java.lang.NoSuchMethodError:org.codehaus.groovy.ast.ModuleNode.getStarImports()Ljava / util / List;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!