Skip to content
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

Possible plugin load order issue #42

Closed
ctoestreich opened this issue Nov 11, 2015 · 7 comments
Closed

Possible plugin load order issue #42

ctoestreich opened this issue Nov 11, 2015 · 7 comments

Comments

@ctoestreich
Copy link

Trying to run some of the dbm* commands produces an odd issue where a domain class is using springSecurityService

java.lang.NullPointerException: Cannot invoke method encodePassword() on null object
    at org.codehaus.groovy.runtime.NullObject.invokeMethod(NullObject.java:91) ~[groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48) ~[groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) ~[groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.NullCallSite.call(NullCallSite.java:35) ~[groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) ~[groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) ~[groovy-2.4.5.jar:2.4.5]
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) ~[groovy-2.4.5.jar:2.4.5]
    at com.lunchify.auth.User.encodePassword(User.groovy:88) ~[main/:na]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_40]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_40]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_40]
    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_40]
protected void encodePassword() {
        println '<<<<<<<<<>>>>>>>>>'
        println springSecurityService.encodePassword(password)
        password = springSecurityService ? springSecurityService.encodePassword(password) : password
    }

This issue only came up due to me attempting to use the SSS in a println, but it might want to be changed in this plugin to loadafter spring-security-core

@bwagner5
Copy link

bwagner5 commented Dec 7, 2015

It looks like it's trying to run Bootstrap.groovy. I tried a grails dbm-drop-all and it prints out my Bootstrap logs and fails because the scripts I have running in Bootstrap are failing.

@KerchumA222
Copy link

This isn't restricted to Spring-Security. I have a database seed that only runs when the environment is Environment.DEVELOPMENT, and it tries to seed on any dbm* command.
This means that when I change a domain that gets seeded I have to go to my SeederBootStrap.groovy and comment everything out.

@KerchumA222
Copy link

Will this ever be fixed?

@jameskleeh
Copy link
Contributor

I'm going to close this and create a more descriptive issue, which is a feature request in grails-core to allow commands to skip the Bootstrap process

@jameskleeh
Copy link
Contributor

Relevant issue grails/grails-core#10022

@zyro23
Copy link
Contributor

zyro23 commented Jul 2, 2016

i guess #78 can be closed then as well?

@edwardotis
Copy link

edwardotis commented Dec 20, 2016

@ctoestreich I'm having the a similar problem calling User.encodePassword() from within a dbm changeSet. The springsecurityservice bean used for encoding is not injected into User in grails 3.1, but it was injected properly in grails 2.5.5 during dbm-update

How did you get past this issue? Remove the migration and add the admin user via Bootstrap.groovy?

Grails 3.1.14
database-migration:2.0.0
spring-security-core:3.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants