-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
springSecurityService
is not injected into domain classes
#372
Comments
Did you remove the call to |
Yes, I did. Intellij was complaining about "Recursive constructor invocation". Could you explain the purpose of this() please? Thank you very much! |
Can you explain more what was the issue ? |
I used a script
And I decided to remove the call to |
I discussed this in my "Little Did He Know" talk at Greach and GR8Conf. Here's a link for the talk at Greach: https://www.youtube.com/watch?v=Oxwpqh1h0s0 - It's one of the first topics so you don't need to watch the whole thing (but feel free to do so ;) I created an issue in the IDEA bug tracker so hopefully they'll have a fix in an upcoming release. For now it's frustrating to have a false error in the IDE, but it's safe to ignore since everything works at runtime. |
ok thanks for info |
Thank you Burt! Could have a look at http://stackoverflow.com/questions/32222792/angular-frontend-authentication-when-using-grails-and-spring-security-for-backen please? I'm having a hard time to do the authentication right... |
BTW, how to supress error warning (recurisive constructor on this() )in IDEA? Turning off inspections does not help |
The issue I raised in their bug tracker is scheduled for the version 15 release: https://youtrack.jetbrains.com/issue/IDEA-144371 |
@burtbeckwith I've been trying to use springSecurityService on the domain class but it seems it's always null. I created a project and added spring-security-rest as dependency. Then I ran s2-quickstart to generate the User and Role classes. If I open the grails console and instantiate a new User() springSecurityService will be null. |
Having parameterized constructors works well in 3.0.x when people understand what's going on and don't comment out that call to |
@burtbeckwith it didn't work with the Map constructor either. |
Did you remove or comment out the parameterized constructor? Using the map constructor isn't a workaround - having the parameterized constructor causes dependency injection to fail all or part of the time, so it has to be removed. |
@burtbeckwith I removed the constructor, it didn't work. This is what the class looks like:
|
I followed the spring security plugin tutorial for my existing project and created domain classes for user and role as described in tutorial.
But when the encodePassword() method is called, the
springSecurityService
isnull
I looked at the grails output, but everything looks fine:
Out of curiosity I created a new empty grails project and as expected
springSecurityService
is injected correctly.Is there any security plugin log or how could I understand why the service is null?
The text was updated successfully, but these errors were encountered: