Grails 1.4.0.M1(带有 STS 2.7.0.M2)GantBuilder 的 NoClassDefFoundError
我刚刚升级到...
- 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果我的理解是正确的,Grails 不会使用 groovy/lib 文件夹中的 jar,而是使用 Grails Installation 文件夹中的 jar。您可能想尝试一下:
根据此处的帖子,您应该转到已安装的 Grails 文件夹 (%GRAILS_HOME%)。在该文件夹中,找到 lib 文件夹,然后指定您拥有的 gant_groovy.jar 的正确版本。然后将 %GRAILS_HOME%/bin/startGrails.bat 编辑为文本并添加以下行:
请注意,上面行中的路径不是很准确(每个发行版似乎都不同)。您应该在 %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:
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.