Details
Description
I'm using OSIV to allow my DWR service to access live domain objects.
web.xml:
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>singleSession</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/dwr/*</url-pattern>
</filter-mapping>
Now, Domain.(anymethod) throws the following error in integration tests:
Cannot locate GORM API implementation. You either don't have a GORM implementation installed (such as the Hibernate plugin) or you are running Grails code outside the context of a Grails application.
This is a regression from 1.3.7.
I can reproduce the issue.
If the domain class has id, and version attributes defined, it is causing the above error
-
Hide
- application-1.3.7-bug-report-28092011-min.zip
- 28/Sep/11 5:40 AM
- 85 kB
- Raviteja
-
- grails-app/conf/BootStrap.groovy 0.1 kB
- grails-app/conf/BuildConfig.groovy 2 kB
- grails-app/conf/Config.groovy 7 kB
- grails-app/conf/DataSource.groovy 0.6 kB
- grails-app/conf/GebConfig.groovy 0.8 kB
- grails-app/conf/UrlMappings.groovy 0.3 kB
- grails-app/conf/spring/resources.groovy 0.2 kB
- grails-app/.../AbstractAnnotation.groovy 0.2 kB
- grails-app/domain/.../Accession.groovy 1 kB
- grails-app/.../AccountApprovalStatus.groovy 0.3 kB
- grails-app/.../AnalyzedSequenceData.groovy 0.5 kB
- grails-app/domain/.../Assertion.groovy 2 kB
- grails-app/domain/.../Assignment.groovy 0.5 kB
- grails-app/domain/.../AssignmentType.groovy 0.3 kB
- grails-app/domain/.../CDSCoordinates.groovy 0.4 kB
- grails-app/domain/.../domain/CGWOrder.groovy 1 kB
- grails-app/domain/.../CaptureSet.groovy 0.5 kB
- grails-app/domain/.../domain/Category.groovy 0.5 kB
- grails-app/domain/.../Chromosome.groovy 0.3 kB
- grails-app/.../ClinicalInterpretation.groovy 0.3 kB
- grails-app/domain/.../CodeRestriction.groovy 0.3 kB
- grails-app/domain/.../Consequence.groovy 0.3 kB
- grails-app/domain/.../domain/Coverage.groovy 0.4 kB
- grails-app/.../CuratedClinicalInterpretation.groovy 2 kB
- grails-app/domain/.../domain/Disease.groovy 0.4 kB
- grails-app/domain/.../EnumRestriction.groovy 0.5 kB
- grails-app/domain/.../EnumValue.groovy 0.7 kB
- grails-app/.../FloatRangeRestriction.groovy 0.6 kB
- grails-app/domain/.../domain/Gender.groovy 0.3 kB
- grails-app/domain/edu/.../domain/Gene.groovy 0.9 kB
-
Hide
- bug-report.zip
- 28/Sep/11 5:39 AM
- 5.67 MB
- Raviteja
-
- application-2-upgrade/.../AbstractAnnotation.groovy 0.2 kB
- application-2-upgrade/.../Accession.groovy 1 kB
- application-2-upgrade/.../AccountApprovalStatus.groovy 0.3 kB
- application-2-upgrade/.../AnalyzedSequenceData.groovy 0.5 kB
- application-2-upgrade/.../Assertion.groovy 2 kB
- application-2-upgrade/.../Assignment.groovy 0.5 kB
- application-2-upgrade/.../AssignmentType.groovy 0.3 kB
- application-2-upgrade/.../CDSCoordinates.groovy 0.4 kB
- application-2-upgrade/.../CGWOrder.groovy 1 kB
- application-2-upgrade/.../CaptureSet.groovy 0.5 kB
- application-2-upgrade/.../Category.groovy 0.5 kB
- application-2-upgrade/.../Chromosome.groovy 0.3 kB
- application-2-upgrade/.../ClinicalInterpretation.groovy 0.3 kB
- application-2-upgrade/.../CodeRestriction.groovy 0.3 kB
- application-2-upgrade/.../Consequence.groovy 0.3 kB
- application-2-upgrade/.../Coverage.groovy 0.4 kB
- application-2-upgrade/.../CuratedClinicalInterpretation.groovy 2 kB
- application-2-upgrade/.../Disease.groovy 0.4 kB
- application-2-upgrade/.../EnumRestriction.groovy 0.5 kB
- application-2-upgrade/.../EnumValue.groovy 0.7 kB
- application-2-upgrade/.../FloatRangeRestriction.groovy 0.6 kB
- application-2-upgrade/.../Gender.groovy 0.3 kB
- application-2-upgrade/.../Gene.groovy 0.9 kB
- application-2-upgrade/.../GeneAlias.groovy 0.3 kB
- application-2-upgrade/.../GeneCoordinates.groovy 0.5 kB
- application-2-upgrade/.../GenomicBuildInfo.groovy 0.6 kB
- application-2-upgrade/.../GenomicLoadInfo.groovy 0.5 kB
- application-2-upgrade/.../GenomicSequence.groovy 0.6 kB
- application-2-upgrade/.../InferredClinicalIntepretation.groovy 1 kB
- application-2-upgrade/.../InformaticsJob.groovy 1.0 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
I tried adding plugins
{ compile ":hibernate:$grailsVersion" }, but my 1.3.7 project upgraded to 1.4.0M1 still fails. I tried to reproduce this issue from a clean application with the minimal amount of configuration, but I can't seem to create a simple failure. Even with the plugin in my other project, I still get IllegalStateException.
hmm well without a reproducible example it is kinda hard to say what the problem is
Was unable to reproduce the error by creating a new project but it's reproducible on the production code of our project.
grails run-app | Compiling 1 source files | Compiling 3 source files. No external configuration file defined..... | Compiling 3 source files..... No external configuration file defined..... | Running Grails application Configuring Spring Security ... Configuring Spring Security LDAP ... Configuring Spring Security UI ... | Error 2011-09-28 14:21:56,944 [Thread-9] ERROR context.GrailsContextLoader - Error executing bootstraps: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot locate GORM API implementation. You either don't have a GORM implementation installed (such as the Hibernate plugin) or you are running Grails code outside the context of a Grails application. Line | Method ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 138 | run in java.util.concurrent.FutureTask | 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run in '' ^ 662 | run . . in java.lang.Thread Caused by BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot locate GORM API implementation. You either don't have a GORM implementation installed (such as the Hibernate plugin) or you are running Grails code outside the context of a Grails application. ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 138 | run in java.util.concurrent.FutureTask | 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run in '' ^ 662 | run . . in java.lang.Thread Caused by BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot locate GORM API implementation. You either don't have a GORM implementation installed (such as the Hibernate plugin) or you are running Grails code outside the context of a Grails application. ->> 303 | innerRun in java.util.concurrent.FutureTask$Sync - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 138 | run in java.util.concurrent.FutureTask | 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run in '' ^ 662 | run . . in java.lang.Thread Caused by IllegalStateException: Cannot locate GORM API implementation. You either don't have a GORM implementation installed (such as the Hibernate plugin) or you are running Grails code outside the context of a Grails application. ->> 24 | doCall in <SOME_CLASS>$__clinit__closure1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 303 | innerRun in java.util.concurrent.FutureTask$Sync | 138 | run . . in java.util.concurrent.FutureTask | 886 | runTask in java.util.concurrent.ThreadPoolExecutor$Worker | 908 | run . . in '' ^ 662 | run in java.lang.Thread
Right, that doesn't really help though. Without valid steps to reproduce we're unable to prioritize this issue.
Which zip should be tested application-1.3.7-bug-report-28092011-min.zip?
Ok I can reproduce with the min example. The problematic line is
load nullable : false
In GenomicBuildInfo which incorrectly tries to call a GORM method instead of applying the constraint to the property
Do you actually have hibernate installed? If so please attach an example that reproduces the problem