Grails 1.4.0.M1(带有 STS 2.7.0.M2)GantBuilder 的 NoClassDefFoundError

发布于 2024-11-15 10:52:59 字数 2482 浏览 5 评论 0原文

我刚刚升级到...

  • Grails 1.4.0.M1
  • Groovy 1.8.0
  • STS 版本:2.7.0.M2 内部版本 ID:201106101000 - Mac 的 64 位 Cocoa 版本
  • 我有 OS X 10.5.8。使用 JVM 1.5.0

当我在现有项目上运行 grails 命令(例如“create-app”或“upgrade”)时,我会收到以下 GantBuilder 的 NoClassDefFoundError 错误。 (完整跟踪见下文)

来自 此论坛的类似问题的建议解决方案 是 gant_groovy1.8-1.9.5.jar 丢失。我已将其直接添加到项目中,也添加到 groovy/lib 文件夹中(然后转到 STS -> 首选项 -> Groovy -> 编译器 -> 更新所有 Groovy 类路径容器),但我仍然收到错误。 (当我将 gant_groovy1.8-1.9.5.jar 添加到 groovy/lib 时,它是一个单独的 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)

有人有什么想法吗?

I have just upgraded to...

  • Grails 1.4.0.M1
  • Groovy 1.8.0
  • STS Version: 2.7.0.M2 Build Id: 201106101000 - 64bit Cocoa version for Mac
  • I have OS X 10.5.8. with JVM 1.5.0

When I run a grails command eg 'create-app' or 'upgrade' on an existing project I get the following NoClassDefFoundError for the GantBuilder. (see below for full trace)

A proposed solution for a similar problem from this forum is that gant_groovy1.8-1.9.5.jar is missing. I've added this to the project directly and also to a groovy/lib folder (and gone to STS -> preferences -> Groovy -> compiler -> Update All Groovy Classpath Containers) but I still get the error. (When I added gant_groovy1.8-1.9.5.jar to groovy/lib it was to a separate groovy download, I'm not sure which groovy/lib folder STS uses for the internal grails shell commands or how to view the STS groovy class path)

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)

Does anyone have any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

活雷疯 2024-11-22 10:52:59

如果我的理解是正确的,Grails 不会使用 groovy/lib 文件夹中的 jar,而是使用 Grails Installation 文件夹中的 jar。您可能想尝试一下:

根据此处的帖子,您应该转到已安装的 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 并相应地更改路径。

If what I understand is right, Grails don't use the jar in your groovy/lib folder, but the jar in the Grails Installation folder. You may want to try this:

According to the post here, you should go to the Installed Grails Folder (%GRAILS_HOME%). In that folder, find the lib folder, and specify the right version of gant_groovy.jar that you have. Then edit the %GRAILS_HOME%/bin/startGrails.bat as text and add this line:

( 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 
)

Note that the path on the above line is not very accurate(it seems different for each distribution). You should find the required jar in the %GRAILS_HOME% folder and change the path accordingly.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文