Hi
I have a controller which creates a command object (which is placed under src/groovy). This command object has a non-static method in which I want to use a service which is injected in the command. I face a nullpointerexception here.
I feel this should work as this is pretty straightforward. I am using grails 2.2.0
Example code
src/groovy
I tried th e following but these did not work.
1. to place the service in resources.groovy
2. Autowire the someService explicitly
3. tried to use grailsApplication.mainContext // in this case the grailsApplication was null
4. tried to use @Configurable on the TTTCommand and @Autowired on the service
Any pointers would be of great help.