Hi,
 
I'm having trouble accessing the grailsApplication instance in a
Service.
 
When I run an integration test against the following code it errors out
with:
 
java.lang.NullPointerException: Cannot get property 'repository' on null
object
 
------------------------- 8< -------------------------
import org.springframework.beans.factory.InitializingBean

class ExampleService implements InitializingBean { 
        def grailsApplication 
        def setting

        void afterPropertiesSet() { 
                println "This line gets printed to STDOUT"
                this.setting = grailsApplication.config.bundle 
        } 
        
        void printRepository(){
                // The following throws an NPE
                println "Repository is " + setting.repository.svnUrl
        }
}

------------------------- 8< -------------------------

Can anyone see what I'm doing wrong?

Thanks!

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

    http://xircles.codehaus.org/manage_email


Reply via email to