gpt4 book ai didi

eclipse - 用于GantBuilder的Grails 1.4.0.M1(带有STS 2.7.0.M2)NoClassDefFoundError

转载 作者:行者123 更新时间:2023-12-02 14:37:51 25 4
gpt4 key购买 nike

我刚刚升级到...

  • Grails 1.4.0.M1
  • Groovy 1.8.0
  • STS版本:2.7.0.M2 Build ID:201106101000-适用于Mac的64位 cocoa 版本
  • 我有OS X 10.5.8。与JVM 1.5.0一起

  • 当我在现有项目上运行grails命令(例如“create-app”或“upgrade”)时,我得到GantBuilder的以下NoClassDefFoundError。 (请参阅下面的完整跟踪)

    针对 this forum中类似问题的建议解决方案是缺少gant_groovy1.8-1.9.5.jar。我已经将它直接添加到项目中,也添加到了groovy / lib文件夹中(并转到STS->首选项-> Groovy->编译器->更新所有Groovy Classpath容器),但是仍然出现错误。 (当我向groovy / lib添加gant_groovy1.8-1.9.5.jar到单独的groovy下载时,我不确定STS将哪个groovy / lib文件夹用于内部grails shell命令或如何查看STS groovy类路径)
    found org.springframework#spring-test;3.1.0.M1 in default
    :: resolution report :: resolve 2068ms :: artifacts dl 119ms
    ---------------------------------------------------------------------
    | | modules || artifacts |
    | conf | number| search|dwnlded|evicted|| number|dwnlded|
    ---------------------------------------------------------------------
    | test | 74 | 0 | 0 | 0 || 74 | 0 |
    ---------------------------------------------------------------------
    Script threw exception
    java.lang.NoClassDefFoundError: org.codehaus.gant.GantBuilder
    at org.codehaus.gant.GantBinding.class$(GantBinding.groovy)
    at org.codehaus.gant.GantBinding.$get$$class$org$codehaus$gant$GantBuilder(GantBinding.groovy)
    at org.codehaus.gant.GantBinding.<init>(GantBinding.groovy:41)
    at org.codehaus.groovy.grails.cli.GrailsScriptRunner.callPluginOrGrailsScript(GrailsScriptRunner.java:448)
    at org.codehaus.groovy.grails.cli.GrailsScriptRunner.runInteractive(GrailsScriptRunner.java:377)
    at org.codehaus.groovy.grails.cli.GrailsScriptRunner.executeCommand(GrailsScriptRunner.java:308)
    at org.codehaus.groovy.grails.cli.GrailsScriptRunner.main(GrailsScriptRunner.java:130)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:592)
    at org.codehaus.groovy.grails.cli.support.GrailsStarter.rootLoader(GrailsStarter.java:234)
    at org.codehaus.groovy.grails.cli.support.GrailsStarter.main(GrailsStarter.java:262)

    有人有什么想法吗?

    最佳答案

    如果我理解的是正确的,则Grails不会使用groovy / lib文件夹中的jar,而是使用Grails安装文件夹中的jar。您可能要尝试以下操作:

    根据here的帖子,您应该转到Installed Grails文件夹(%GRAILS_HOME%)。在该文件夹中,找到lib文件夹,然后指定所拥有的gant_groovy.jar的正确版本。然后将%GRAILS_HOME%/ bin / startGrails.bat编辑为文本,并添加以下行:

    ( set STARTER_CLASSPATH=%GRAILS_HOME%\lib\org.codehaus.groovy\groovy-all\jars\groovy-all-1.8.0.jar;%GRAILS_HOME%\dist\grails-bootstrap-1.4.0.M1.jar;%GRAILS_HOME%\lib\org.codehaus.gant\gant_groovy1.8\jars\gant_groovy1.8-1.9.5.jar 
    )

    请注意,上一行的路径不是很准确(每种分布似乎都不同)。您应该在%GRAILS_HOME%文件夹中找到所需的jar,然后相应地更改路径。

    关于eclipse - 用于GantBuilder的Grails 1.4.0.M1(带有STS 2.7.0.M2)NoClassDefFoundError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6367763/

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