Question

I have just created an sample application with grails-2.2.3. When I am running this application using grails run-app it is working fine as usual but client want to use gradle for build the application. I have install the grails-gradle plugin and setup the application. When I am running the gradle grails-run-app without any domain it works fine. But when I have created a domain and tried to bootstrap the data then it is throwing the following exceptions

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

I am attaching the source code for reproduce the same. https://www.dropbox.com/sh/w4z1z6pyc22dqqz/m08RdilDCv please download the application from here.

Thanks Amit

Was it helpful?

Solution

As I have look build.gradle I found that you have exclude the hibernate dependency

compile {
    exclude module: 'hibernate'
} 

After removing it I am able to run the application.

Please try it at your end and let me know.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top