gpt4 book ai didi

grails - Gradle插件不适用于Grails 2.2.3

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

我刚刚用grails-2.2.3创建了一个示例应用程序。当我使用grails run-app运行此应用程序时,它可以像往常一样正常运行,但是客户端希望使用gradle构建该应用程序。我已经安装了grails-gradle插件并设置了应用程序。当我在没有任何域的情况下运行gradle grails-run-app时,它工作正常。但是,当我创建一个域并尝试引导数据时,它将引发以下异常

| Error 2014-02-21 10:28:54,355 [localhost-startStop-1] ERROR context.GrailsContextLoader  - Error initializing Grails: groovy.lang.MissingMethodException: No signature of method: com.user.User.save() is applicable for argument types: () values: []
Possible solutions: save(), save(boolean), save(java.util.Map), wait(), last(), any()
Message: groovy.lang.MissingMethodException: No signature of method: com.user.User.save() is applicable for argument types: () values: []
Possible solutions: save(), save(boolean), save(java.util.Map), wait(), last(), any()
Line | Method
->> 308 | evaluateEnvironmentSpecificBlock in grails.util.Environment
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 301 | executeForEnvironment in ''
| 277 | executeForCurrentEnvironment . . in ''
| 303 | innerRun in java.util.concurrent.FutureTask$Sync
| 138 | run . . . . . . . . . . . . . . in java.util.concurrent.FutureTask
| 895 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker
| 918 | run . . . . . . . . . . . . . . in ''
^ 662 | run in java.lang.Thread

Caused by MissingMethodException: No signature of method: com.user.User.save() is applicable for argument types: () values: []
Possible solutions: save(), save(boolean), save(java.util.Map), wait(), last(), any()

我附上了用于重现的源代码。 https://www.dropbox.com/sh/w4z1z6pyc22dqqz/m08RdilDCv,请从此处下载应用程序。

谢谢
阿米特

最佳答案

当我查看build.gradle时,我发现您已经排除了休眠依赖

compile {
exclude module: 'hibernate'
}

删除后,我可以运行该应用程序。

请在您结束时尝试,让我知道。

关于grails - Gradle插件不适用于Grails 2.2.3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21925788/

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