2014-02-21 120 views
1

我剛剛用grails-2.2.3創建了一個示例應用程序。當我使用grails run-app運行這個應用程序時,它像往常一樣正常工作,但客戶端希望使用gradle來構建應用程序。我已安裝grails-gradle插件並設置應用程序。當我運行沒有任何域的gradle grails-run-app時,它工作正常。但是,當我創建了一個域名,並試圖引導數據則拋出以下例外Gradle插件與Grails 2.2.3不兼容

| 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請從這裏下載應用程序。

感謝 阿米特

回答

1

因爲我有看build.gradle我發現您有排除休眠依賴

compile { 
    exclude module: 'hibernate' 
} 

取出後我能夠運行應用程序。

請在你的最後嘗試一下,讓我知道。

+1

感謝您的回答。有用。 – user9873999

相關問題