Grails 2.3 with Spring Security

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Grails 2.3 with Spring Security

mraible
Upgrading my app from Grails 2.2.1 to Grails 2.3.0 and using Spring Security 1.2.7.3. I have a custom UserDetails object:

https://github.com/jamesward/happytrails/blob/grails2/grails-app/services/happytrails/CustomUserDetails.groovy

And a custom UserDetailsService:

https://github.com/jamesward/happytrails/blob/grails2/grails-app/services/happytrails/UserDetailsService.groovy

When logging in, I get the following error:
Error 500: Internal Server Error
URI
/j_spring_security_check
Class
java.lang.NoSuchMethodError
Message
happytrails.User.isEnabled()Z
Around line 46 of grails-app/services/happytrails/UserDetailsService.groovy
43: userDetails = new CustomUserDetails(44: user.username,45: user.password,46: user.enabled,47: !user.accountExpired,48: !user.passwordExpired,49: !user.accountLocked,
Around line 32 of grails-app/services/happytrails/UserDetailsService.groovy
29:30: UserDetails userDetails = null31:32: User.withSession {33:34: User user = User.findWhere(username: _username) as User35:
Trace
    Line | Method
->> 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by NoSuchMethodError: happytrails.User.isEnabled()Z
->>   46 | doCall    in UserDetailsService.groovy
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|     32 | loadUserByUsername in     ''
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Has this API somehow changed with Grails 2.3.0?

Thanks,

Matt

P.S. A diff of my 2.2.1 -> 2.3.0 changes: https://gist.github.com/mraible/6664775
Reply | Threaded
Open this post in threaded view
|

Re: Grails 2.3 with Spring Security

burtbeckwith
That has nothing to do with Spring Security, it's just calling the enabled property of your User class. Have you tried "grails clean" and/or deleting the target and work directory?

Burt

mraible wrote
Upgrading my app from Grails 2.2.1 to Grails 2.3.0 and using Spring Security 1.2.7.3. I have a custom UserDetails object:

https://github.com/jamesward/happytrails/blob/grails2/grails-app/services/happytrails/CustomUserDetails.groovy

And a custom UserDetailsService:

https://github.com/jamesward/happytrails/blob/grails2/grails-app/services/happytrails/UserDetailsService.groovy

When logging in, I get the following error:
Error 500: Internal Server Error
URI
/j_spring_security_check
Class
java.lang.NoSuchMethodError
Message
happytrails.User.isEnabled()Z
Around line 46 of grails-app/services/happytrails/UserDetailsService.groovy
43: userDetails = new CustomUserDetails(44: user.username,45: user.password,46: user.enabled,47: !user.accountExpired,48: !user.passwordExpired,49: !user.accountLocked,
Around line 32 of grails-app/services/happytrails/UserDetailsService.groovy
29:30: UserDetails userDetails = null31:32: User.withSession {33:34: User user = User.findWhere(username: _username) as User35:
Trace
    Line | Method
->> 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by NoSuchMethodError: happytrails.User.isEnabled()Z
->>   46 | doCall    in UserDetailsService.groovy
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|     32 | loadUserByUsername in     ''
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Has this API somehow changed with Grails 2.3.0?

Thanks,

Matt

P.S. A diff of my 2.2.1 -> 2.3.0 changes: https://gist.github.com/mraible/6664775
Reply | Threaded
Open this post in threaded view
|

Re: Grails 2.3 with Spring Security

mraible
I tried running "grails clean" and "grails run-app" again and I get the same error. If I revert to Grails 2.2.1, everything works fine.

burtbeckwith wrote
That has nothing to do with Spring Security, it's just calling the enabled property of your User class. Have you tried "grails clean" and/or deleting the target and work directory?

Burt

mraible wrote
Upgrading my app from Grails 2.2.1 to Grails 2.3.0 and using Spring Security 1.2.7.3. I have a custom UserDetails object:

https://github.com/jamesward/happytrails/blob/grails2/grails-app/services/happytrails/CustomUserDetails.groovy

And a custom UserDetailsService:

https://github.com/jamesward/happytrails/blob/grails2/grails-app/services/happytrails/UserDetailsService.groovy

When logging in, I get the following error:
Error 500: Internal Server Error
URI
/j_spring_security_check
Class
java.lang.NoSuchMethodError
Message
happytrails.User.isEnabled()Z
Around line 46 of grails-app/services/happytrails/UserDetailsService.groovy
43: userDetails = new CustomUserDetails(44: user.username,45: user.password,46: user.enabled,47: !user.accountExpired,48: !user.passwordExpired,49: !user.accountLocked,
Around line 32 of grails-app/services/happytrails/UserDetailsService.groovy
29:30: UserDetails userDetails = null31:32: User.withSession {33:34: User user = User.findWhere(username: _username) as User35:
Trace
    Line | Method
->> 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Caused by NoSuchMethodError: happytrails.User.isEnabled()Z
->>   46 | doCall    in UserDetailsService.groovy
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|     32 | loadUserByUsername in     ''
|   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread

Has this API somehow changed with Grails 2.3.0?

Thanks,

Matt

P.S. A diff of my 2.2.1 -> 2.3.0 changes: https://gist.github.com/mraible/6664775
Reply | Threaded
Open this post in threaded view
|

Re: Grails 2.3 with Spring Security

Graeme Rocher-2
This seems to be a bug in @CompileStatic, might be worth creating a Groovy JIRA. The following change fixes the problem for me:



On Mon, Sep 23, 2013 at 2:40 AM, mraible <[hidden email]> wrote:
I tried running "grails clean" and "grails run-app" again and I get the same
error. If I revert to Grails 2.2.1, everything works fine.


burtbeckwith wrote
> That has nothing to do with Spring Security, it's just calling the enabled
> property of your User class. Have you tried "grails clean" and/or deleting
> the target and work directory?
>
> Burt
> mraible wrote
>> Upgrading my app from Grails 2.2.1 to Grails 2.3.0 and using Spring
>> Security 1.2.7.3. I have a custom UserDetails object:
>>
>> https://github.com/jamesward/happytrails/blob/grails2/grails-app/services/happytrails/CustomUserDetails.groovy
>>
>> And a custom UserDetailsService:
>>
>> https://github.com/jamesward/happytrails/blob/grails2/grails-app/services/happytrails/UserDetailsService.groovy
>>
>> When logging in, I get the following error:
>> Error 500: Internal Server Error
>> URI
>> /j_spring_security_check
>> Class
>> java.lang.NoSuchMethodError
>> Message
>> happytrails.User.isEnabled()Z
>> Around line 46 of
>> grails-app/services/happytrails/UserDetailsService.groovy
>> 43:                  userDetails = new CustomUserDetails(44:                                 user.username,45:
>> user.password,46:                                    user.enabled,47:                                        !user.accountExpired,48:
>> !user.passwordExpired,49:                                    !user.accountLocked,
>> Around line 32 of
>> grails-app/services/happytrails/UserDetailsService.groovy
>> 29:30:               UserDetails userDetails = null31:32:            User.withSession {33:34:
>> User user = User.findWhere(username: _username) as User35:
>> Trace
>>     Line | Method
>> ->> 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> |    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
>> ^    722 | run . . . in java.lang.Thread
>>
>> Caused by NoSuchMethodError: happytrails.User.isEnabled()Z
>> ->>   46 | doCall    in UserDetailsService.groovy
>> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>> |     32 | loadUserByUsername in     ''
>> |   1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
>> |    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
>> ^    722 | run . . . in java.lang.Thread
>>
>> Has this API somehow changed with Grails 2.3.0?
>>
>> Thanks,
>>
>> Matt
>>
>> P.S. A diff of my 2.2.1 -> 2.3.0 changes:
>> https://gist.github.com/mraible/6664775





--
View this message in context: http://grails.1312388.n4.nabble.com/Grails-2-3-with-Spring-Security-tp4649418p4649421.html
Sent from the Grails - user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email





--
Graeme Rocher
Grails Project Lead
SpringSource