How to use Grails dataSource in .groovy resources?

I have an external java library that I use in my Grails project. It needs a data source through Spring configuration. However, the dataSource does not seem to be available from resources.groovy. How do I access it? I use the following in resources.groovy:

beans = {
 eventDao(com.JavaClassRequiringDataSource) {
  //dataSource = ref(dataSource, true)
  dataSource = dataSource
 }
}

Running the application throws an exception:

org.codehaus.groovy.runtime.InvokerInvocationException: groovy.lang.MissingPropertyException: No such property: dataSource for class: grails.spring.BeanBuilder

Any ideas?

+5
source share
1 answer

http://www.grails.org/Spring+Bean+Builder .. Googleing , ()

beans = {
 eventDao(com.JavaClassRequiringDataSource) {
  dataSource = ref('dataSource', true)
 }
}

, . (: http://burtbeckwith.com/blog/?cat=23)

+7

All Articles