出于某种原因,“grails war”在“WEB-INF/lib”中包含“groovy-1.6.9.jar”和“groovy-all-1.7.8.jar”文件。我正在使用 Grails 1.3.7,当我在 Tomcat 中部署这场战争时,我收到以下错误:
org.springframework.beans.factory.BeanCreationException:在 ServletContext 资源 [/WEB-INF/applicationContext.xml] 中定义名称为“pluginManager”的 bean 创建错误:调用 init 方法失败;嵌套异常是 java.lang.NoSuchMethodError: org.codehaus.groovy.control.SourceUnit.getSource()Lorg/codehaus/groovy/control/io/ReaderSource;
我能够部署战争的唯一方法是删除旧的 groovy 文件并且应用程序运行良好。
我调试了依赖过程,我能找到的是:
[NOT REQUIRED] org.codehaus.groovy#groovy;1.6.9!groovy.jar
...
:: evicted modules:
junit#junit;3.8.2 by [junit#junit;4.8.1] in [test]
in org.codehaus.groovy#groovy;1.6.9 with latest-revision
因此,我继续并找到了包含以下内容的文件“org.codehaus.groovy.modules.http-builder/http-builder/ivy-0.5.0-RC2.xml”:
<dependency org="org.codehaus.groovy" name="groovy" rev="[1.5,1.6.99)"
我将此行更改为“[1.7,1.7.8)”,并且依赖过程运行良好,现在战争部署没有任何问题,但我以前从未接触过这些,我很担心。这是处理 Grails 依赖项的正确方法吗?
所有这一切都是在安装 JQuery UI 插件之后开始发生的,即使在删除它之后,问题仍然存在。
谢谢