Note that there are some explanatory texts on larger screens.

plurals
  1. POMethod not found - findOrCreateWhere - gorm
    text
    copied!<p>I have created a Role class that contains only one variable authority:</p> <pre><code>class Role { String authority } </code></pre> <p>Now when I try to save new values in BootStrap.groovy (grails app) I am doing this: </p> <pre><code>def adminRole = Role.findOrCreateWhere(authority: "ROLE_ADMIN"); </code></pre> <p>When I am running this I am getting the following exception: </p> <pre><code>2012-01-29 23:35:03,067 [Thread-9] ERROR org.codehaus.groovy.grails.web.context.GrailsContextLoader - Error executing bootstraps: groovy.lang.MissingMethodException: No signature of method: org.rango.auth.Role.findOrCreateWhere() is applicable for argument types: () values: [] Possible solutions: findOrCreateWhere(java.util.Map), findOrSaveWhere(java.util.Map) org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: org.rango.auth.Role.findOrCreateWhere() is applicable for argument types: () values: [] Possible solutions: findOrCreateWhere(java.util.Map), findOrSaveWhere(java.util.Map) at grails.util.Environment.evaluateEnvironmentSpecificBlock(Environment.java:290) at grails.util.Environment.executeForEnvironment(Environment.java:283) at grails.util.Environment.executeForCurrentEnvironment(Environment.java:259) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: groovy.lang.MissingMethodException: No signature of method: org.rango.auth.Role.findOrCreateWhere() is applicable for argument types: () values: [] Possible solutions: findOrCreateWhere(java.util.Map), findOrSaveWhere(java.util.Map) at BootStrap$_closure1.doCall(BootStrap.groovy:16) ... 8 more </code></pre> <p>What's wrong with my code?</p> <p>Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload