You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to build a plugin with multitenency feature that carries all the domain object so that it can be shared across multiple grails based web-application, but on writing a simple unit-test I am seeing that the Unit-test denies to identify the Domain class in the plugin as a domain at all.
If I run the same test by linking it with the Domain object in the project itself instead of Plugin, everything works fine, I cannot have the test placed in plugin itself as the heavy implementation will be on the specific service end, any idea on it, below is the code snippet, where Benefit is the domain obect that lies inside the inplace plugin:-
Following is the error I am gettin on the end of the unit test
Either class [com.common.domain.Benefit] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.
java.lang.IllegalStateException: Either class [com.common.domain.Benefit] is not a domain class or GORM has not been initialized correctly or has already been shutdown. Ensure GORM is loaded and configured correctly before calling any methods on a GORM entity.
at org.grails.datastore.gorm.GormEnhancer.stateException(GormEnhancer.groovy:472)
at org.grails.datastore.gorm.GormEnhancer.findDatastore(GormEnhancer.groovy:354)
at org.grails.datastore.gorm.GormEnhancer.findTenantId(GormEnhancer.groovy:268)
at org.grails.datastore.gorm.GormEnhancer.findStaticApi(GormEnhancer.groovy:299)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.currentGormStaticApi(GormEntity.groovy:1368)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.findAll(GormEntity.groovy:689)
at org.grails.datastore.gorm.GormEntity$Trait$Helper.findAll(GormEntity.groovy:688)
at test.TestService.$tt__serviceMethod(TestService.groovy:15)
at test.TestService._mt__serviceMethod_closure3(TestService.groovy)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:434)
at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)
at test.TestService.serviceMethod_closure1(TestService.groovy)
at groovy.lang.Closure.call(Closure.java:418)
at groovy.lang.Closure.call(Closure.java:434)
at grails.gorm.multitenancy.Tenants.withId_closure2$_closure6(Tenants.groovy:265)
at org.grails.orm.hibernate.GrailsHibernateTemplate$1.doInHibernate(GrailsHibernateTemplate.java:153)
at org.grails.orm.hibernate.GrailsHibernateTemplate.doExecute(GrailsHibernateTemplate.java:299)
at org.grails.orm.hibernate.GrailsHibernateTemplate.execute(GrailsHibernateTemplate.java:243)
at org.grails.orm.hibernate.GrailsHibernateTemplate.executeWithNewSession(GrailsHibernateTemplate.java:150)
at org.grails.orm.hibernate.GrailsHibernateTemplate.executeWithExistingOrCreateNewSession(GrailsHibernateTemplate.java:209)
at org.grails.orm.hibernate.AbstractHibernateDatastore.withNewSession(AbstractHibernateDatastore.java:369)
at grails.gorm.multitenancy.Tenants.withId_closure2(Tenants.groovy:258)
at grails.gorm.multitenancy.Tenants$CurrentTenant.withTenant(Tenants.groovy:358)
at grails.gorm.multitenancy.Tenants.withId(Tenants.groovy:236)
at org.grails.datastore.gorm.services.DefaultTenantService.withCurrent(DefaultTenantService.groovy:71)
at test.TestServiceSpec.test something somethng(TestServiceSpec.groovy:38)
The text was updated successfully, but these errors were encountered:
I am trying to build a plugin with multitenency feature that carries all the domain object so that it can be shared across multiple grails based web-application, but on writing a simple unit-test I am seeing that the Unit-test denies to identify the Domain class in the plugin as a domain at all.
If I run the same test by linking it with the Domain object in the project itself instead of Plugin, everything works fine, I cannot have the test placed in plugin itself as the heavy implementation will be on the specific service end, any idea on it, below is the code snippet, where Benefit is the domain obect that lies inside the inplace plugin:-
here is the service
Following is the error I am gettin on the end of the unit test
The text was updated successfully, but these errors were encountered: