Bubuntux
Bubuntux

Reputation: 310

Error with spring security plugin in grails 2.4.0.M1

i'm running into a compilation issue, using grails 2.4.0.M1 and spring-security-core:2.0-RC2

this is the error:

..../target/work/plugins/spring-security-core-2.0-RC2/src/groovy/grails/plugin/springsecurity/ReflectionUtils.groovy: 205: Apparent variable 'org' was found in a static scope but doesn't refer to a local variable, static field or class. Possible causes: You attempted to reference a variable in the binding or an instance variable from a static context. You misspelled a classname or statically imported field. Please check the spelling. You attempted to use a method 'org' but left out brackets in a place not allowed by the grammar. @ line 205, column 18. application = org.codehaus.groovy.grails.commons.ApplicationHolder.application ^

the problem seems to be around this method

private static GrailsApplication getApplication() { 
                if (!application) { 
                        application = org.codehaus.groovy.grails.commons.ApplicationHolder.application 
                } 
                application 
        } 

on the class ReflectionUtils.groovy,

does anyone else as ran into something like this? if so how do you fixed it?

Upvotes: 5

Views: 2594

Answers (2)

Burt Beckwith
Burt Beckwith

Reputation: 75681

I fixed this today - https://github.com/grails-plugins/grails-spring-security-core/commit/ef3aab05bfb0eb2f2cbb2c5945f4fc9ca2f0697d

You can make the change that @Bubuntux showed as a temporary workaround, and I'll be releasing 2.0 final in a couple of weeks with this fixed. Hopefully you're not planning on using a Grails M1 release in production, so the delay shouldn't be too much of an issue.

Upvotes: 3

Bubuntux
Bubuntux

Reputation: 310

Seems like the ApplicationHolder class was deprecated a long time ago, and now removed on grals 2.4

so i just change the line

application = org.codehaus.groovy.grails.commons.ApplicationHolder.application 

to

application = Holders.grailsApplication

Upvotes: 1

Related Questions