I am trying to access grailsApplication in groovy class under src/groovy but I get a null pointer exception. I also tried to inject a service into the
grailsApplication
src/groovy
The ApplicationHolder class is deprecated in newer Grails versions (2.0 and above).
There is another way, which is described in one of Burt's blogposts: http://burtbeckwith.com/blog/?p=1017