Problem referencing userLookup classes from a plugin when using multiple datasources

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem referencing userLookup classes from a plugin when using multiple datasources

Tom Eastmond-2
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
Reply | Threaded
Open this post in threaded view
|

Re: Problem referencing userLookup classes from a plugin when using multiple datasources

Tom Eastmond-2
Apologies - I intended to try in Grails user first. Please disregard.

Thanks,
Tom


On Tue, Mar 4, 2014 at 3:31 PM, Tom Eastmond <[hidden email]> wrote:
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