Discussion:
Problem referencing userLookup classes from a plugin when using multiple datasources
Tom Eastmond
2014-03-04 22:31:55 UTC
Permalink
I've been trying to extract our Spring security domain classes into a
plugin to be used in multiple applications. Additionally, I'm trying to get
the classes to map to a secondary datasource by adding

datasource = 'userLookup' to the mapping closure

When an application starts with this setup, I get the exception included
below indicating no such property: datasource. One thing I noticed while
troubleshooting is that the domain class is a DefaultGrailsDomainClass
instead of a GrailsHibernateDomainClass which sends it down a different
path in GrailsHibernateUtil.usesDatasource.

I'd love any insight into what I might be doing wrong or how I could work
around this issue.

Thanks!
Tom

ERROR context.GrailsContextLoader - Error initializing the application:
Error evaluating ORM mappings block for domain [common.security.User]: No
such property: datasource for class:
org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
Message: Error evaluating ORM mappings block for domain
[common.security.User]: No such property: datasource for class:
org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
Line | Method
->> 129 | doCall in
grails.plugin.hibernate3.HibernatePluginSupport$__clinit__closure1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 756 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
| 584 | beans . . . . . . . . . . in ''
| 527 | invokeMethod in ''
| 262 | run . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in
java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . in
java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
Tom Eastmond
2014-03-04 22:35:08 UTC
Permalink
Apologies - I intended to try in Grails user first. Please disregard.

Thanks,
Tom
Post by Tom Eastmond
I've been trying to extract our Spring security domain classes into a
plugin to be used in multiple applications. Additionally, I'm trying to get
the classes to map to a secondary datasource by adding
datasource = 'userLookup' to the mapping closure
When an application starts with this setup, I get the exception included
below indicating no such property: datasource. One thing I noticed while
troubleshooting is that the domain class is a DefaultGrailsDomainClass
instead of a GrailsHibernateDomainClass which sends it down a different
path in GrailsHibernateUtil.usesDatasource.
I'd love any insight into what I might be doing wrong or how I could work
around this issue.
Thanks!
Tom
Error evaluating ORM mappings block for domain [common.security.User]: No
org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
Message: Error evaluating ORM mappings block for domain
org.codehaus.groovy.grails.orm.hibernate.cfg.HibernateMappingBuilder
Line | Method
->> 129 | doCall in
grails.plugin.hibernate3.HibernatePluginSupport$__clinit__closure1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 756 | invokeBeanDefiningClosure in grails.spring.BeanBuilder
| 584 | beans . . . . . . . . . . in ''
| 527 | invokeMethod in ''
| 262 | run . . . . . . . . . . . in java.util.concurrent.FutureTask
| 1145 | runWorker in
java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . . . . . . . . . in
java.util.concurrent.ThreadPoolExecutor$Worker
^ 744 | run in java.lang.Thread
Loading...