Posts Tagged ‘Grails’

Using an External Configuration in Grails

Tuesday, February 9th, 2010

By default, Grails configuration information is stored in grails-app/config/Config.groovy and contains various settings, including the configuration for logging. While this is convenient, it has caused me concern when deploying applications since Config.groovy will get compiled and placed in the war file. True, you can have different settings based on the environment (development, production, etc.), but often I can not predict what the production environment might be. Perhaps I need to tweak the logger level in production after it has been deployed. Maybe the database needs to be moved to a different server.

External configuration files allow you to make these changes without having to redeploy the war file.
(more…)

MissingMethodException: No signature of method for Grails Dynamic Method

Monday, May 25th, 2009

In my last post, I described how you can use resources.groovy to create and initialize a class. However, you can get into trouble if the initMethod will access any of the dynamic methods that Grails introduces. If you are not careful, you may get an Exception like the following:

groovy.lang.MissingMethodException: No signature of method: static Thing.count() is applicable ...
(more…)

Creating and Initializing Objects using Spring in Grails 1.1

Saturday, April 25th, 2009

I was working on a Grails 1.1 project where I wanted to create and initialize an object using Spring. This class would access a Grails service and would interface with open source libraries. This post shows how to create a Java object that is initialized using Spring with various properties, including wiring in a Grails service class.
(more…)