Released Grails spy plugin
While digging through the inner workings of Grails in order to improve my OSGi plugin, it is sometimes necessary to inspect the GrailsApplication object and its companion Spring ApplicationContext(s).
As most of the beans of the Grails WebApplicationContext are constructed at runtime with the help of a BeanBuilder, there is no Spring xml file with bean definitions.
Only the main application context can be inspected, e.g. by extracting it from the generated war file:
jinspect -a target/myapp-0.1.war
In order to browse the dynamic bean definitions I created a little plugin called Grails Spy, which can be used to watch into an application’s guts.
License
The Spy plugin is released under the Apache License 2.0.
Source code and Issues
The source code is hosted at GitHub, issues can be reported here.
Installation
As always, simply execute grails install-plugin spy.
Note: until the Grails plugin page is sync’ed, the plugin can also be installed using
grails install-pluginhttp://cloud.github.com/downloads/jetztgradnet/grails-spy-plugin/grails-spy-0.1.zip
Usage
Simply browse to http://localhost:8080/myapp/spy/ and have a closer look.
Note: this path is NOT PROTECTED, so don’t do this in a production environment! Or at least use one of the security plugins to protect this page.
Screenshots
Eye-candy you say? See below:
GrailsSpy: GrailsApplication
GrailsSpy: ApplicationContext view
GrailsSpy: bean view




that is really sweet and would make a great troubleshooting tool.