title: Spring Security grails plugin fails when deployed as war tomcat 6
body: <p>I've seen a similar question asked with the exact same error as I have, however the context was different. I am not having problems with testing, rather, user and role creation fail completely on launch.</p>
  
  <p>When using the spring-security-core 1.2.7 plugin with grails 1.3.7 and tomcat 6, I get this failure:</p>
  
  <p>2012-01-04 16:23:12,476 [main] ERROR context.ContextLoader  - Context initialization failed
  org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingMethodException: No signature of method: setTest.Role.save() is applicable for argument types: (java.util.LinkedHashMap) values: [[flush:true]]
  Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), sleep(long), use([Ljava.lang.Object;)
      at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:87)
  ...</p>
  
  <p>The app runs fine when launched with grails runApp, but upon war'ing, it fails to deploy every time. The error seems to center around my user account/role creation in the bootstrap:</p>
  
  <pre><code>def adminRole = new Role(authority: 'ROLE_ADMIN').save(flush: true)
  def userRole = new Role(authority: 'ROLE_USER').save(flush: true)
  def testUser = new User(username: 'me', enabled: true, password: 'password')
  testUser.save(flush: true)
  UserRole.create testUser, adminRole, true
  </code></pre>
  
  <p>This is taken from the springSecurity tutorial directly. Any suggestions?</p>
  
  <p>Edit: Additionally, this also fails with grails prod run-war and it is directly related to role/user creation. Even with different names for users and roles, the problem persists.</p>
  
  <p>Edit 2: Also, the failure is on the .save(), which of course the original error message showed. I verified that a regular .save() vs a save(flush: true) makes no difference.</p>
  
  <p>Edit 3: It seems it might be a bug in the current version of plugin: <a href="http://jira.grails.org/browse/GPSPRINGSECURITYCORE-152" rel="nofollow">http://jira.grails.org/browse/GPSPRINGSECURITYCORE-152</a>
  I'll keep you guys posted!</p>
  
  <p>Edit 4: Confirmed, reverting to version 1.2.6 seems to fix the issue!</p>