Spring Security UI Plugin
  1. Spring Security UI Plugin
  2. GPSPRINGSECURITYUI-11

RegistrationCode.save() fails when application deployed as WAR

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Grails-Spring-Security-UI 0.1
    • Labels:
      None
    • Environment:
      Grails 1.3.4, spring-security-ui 0.1.1

      Description

      I'm getting the following exception when attempting to register a new user via RegisterController.index (after running 'grails s2ui-override package registration'):

      groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode.save() is applicable for argument types: () values: []
      Possible solutions: wait(), any(), wait(long), isCase(java.lang.Object), use([Ljava.lang.Object;), sleep(long)
      
      	at grails.plugins.springsecurity.ui.RegisterController$_closure2.doCall(RegisterController.groovy:53)
      
      	at grails.plugins.springsecurity.ui.RegisterController$_closure2.call(RegisterController.groovy)
      
      	at java.lang.Thread.run(Thread.java:619)
      

      The problem only occurs when deploying the application as WAR (e.g. 'grails run-war'), not when running with 'grails run-app'. I get the same error when creating a minimal spring-security-core and spring-security-ui application for testing the issue, so it would seem that other parts of the application are not to blame.

      The cause obviously seems to be that the RegistrationCode is not mapped as a domain class (checking this with DomainClassArtefactHandler.isDomainClass() seems to confirm it). However, when trying to create an explicit RegistrationCode domain class, a DuplicateMappingException is thrown. A workaround would probably be to create the class with another name and edit RegistrationController to use that, which I haven't yet tried, but will probably have to.

        Activity

        Hide
        derek added a comment - - edited

        Same problem here with version 0.1.2 and grails 1.3.5
        Maybe we are doing something wrong

        Domain class is not mapped from the plugin. The table is also not created in the DB.
        Might try explicitly creating a hibernate mapping for it and see what happens

        Show
        derek added a comment - - edited Same problem here with version 0.1.2 and grails 1.3.5 Maybe we are doing something wrong Domain class is not mapped from the plugin. The table is also not created in the DB. Might try explicitly creating a hibernate mapping for it and see what happens
        Hide
        Finn Johnsen added a comment -

        I got this when submitting the forgot password dialog. My users were not created using register, they were manually created all of them.

        spring-security-ui 0.1.2

        I got this in my production environment, as I was misled by my testing it using 'grails run-app'. (Turns out I've been naive)

        Any suggested work-around?

        org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver - No signature of method: org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode.save() is app
        licable for argument types: () values: []
        Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), each(groovy.lang.Closure), use([Ljava.lang.Object
        groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode.save() is applicable for argument types: () values: []
        Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), each(groovy.lang.Closure), use([Ljava.lang.Object
        at RegisterController.RegisterController$_closure4.doCall(RegisterController.groovy:118)

        Show
        Finn Johnsen added a comment - I got this when submitting the forgot password dialog. My users were not created using register, they were manually created all of them. spring-security-ui 0.1.2 I got this in my production environment, as I was misled by my testing it using 'grails run-app'. (Turns out I've been naive) Any suggested work-around? org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver - No signature of method: org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode.save() is app licable for argument types: () values: [] Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), each(groovy.lang.Closure), use([Ljava.lang.Object groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.grails.plugins.springsecurity.ui.RegistrationCode.save() is applicable for argument types: () values: [] Possible solutions: wait(), any(), wait(long), any(groovy.lang.Closure), each(groovy.lang.Closure), use([Ljava.lang.Object at RegisterController.RegisterController$_closure4.doCall(RegisterController.groovy:118)
        Hide
        Michal Pavlasek added a comment -

        This is probably the problem of grails, not SpringSecurity UI - domain class of plugin is not "visible" in run-war (or war) instead od run-app. (No DB table was created also, when using war or run-war).

        The simplest workaround I used was creating own domain class - RegistrationCode2 and RegisterController extending grails.plugins.springsecurity.ui.RegisterController
        and overriding methods register, forgotPassword, resetPassword and verifyRegistration to use RegistrationCode2
        instead of RegistrationCode.

        Stupid workaround, but it works

        Show
        Michal Pavlasek added a comment - This is probably the problem of grails, not SpringSecurity UI - domain class of plugin is not "visible" in run-war (or war) instead od run-app. (No DB table was created also, when using war or run-war). The simplest workaround I used was creating own domain class - RegistrationCode2 and RegisterController extending grails.plugins.springsecurity.ui.RegisterController and overriding methods register, forgotPassword, resetPassword and verifyRegistration to use RegistrationCode2 instead of RegistrationCode. Stupid workaround, but it works

          People

          • Assignee:
            Burt Beckwith
            Reporter:
            Esa Virtanen
          • Votes:
            4 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: