Details
-
Type:
Bug
-
Status:
In Progress
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.1.1
-
Fix Version/s: None
-
Component/s: Persistence
-
Labels:None
-
Environment:jdk 6, windows
-
Testcase included:yes
Description
I am trying to reference a persistant object that is mapped using hibernate xml in one of my GORM domain classes. Everything compiles, but when I try to startup the app using "grails run-app" I get...
[main] ERROR mortbay.log - Nested in org.springframework.beans.factory.BeanCreationException: 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.NullPointerException:
java.lang.NullPointerException
at org.codehaus.groovy.grails.commons.DefaultGrailsDomainClassProperty.equals(DefaultGrailsDomainClassProperty.java:471)
at org.codehaus.groovy.grails.commons.GrailsDomainConfigurationUtil.configureDomainClassRelationships(GrailsDomainConfigurationUtil.java:135)
at org.codehaus.groovy.grails.commons.DomainClassArtefactHandler.initialize(DomainClassArtefactHandler.java:44)
at org.codehaus.groovy.grails.commons.DefaultGrailsApplication.initializeArtefacts(DefaultGrailsApplication.java:689)
at org.codehaus.groovy.grails.commons.DefaultGrailsApplication.initializeArtefacts(DefaultGrailsApplication.java:675)
at org.codehaus.groovy.grails.commons.DefaultGrailsApplication.addArtefact(DefaultGrailsApplication.java:645)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsHibernateUtil.configureDomainClass(GrailsHibernateUtil.java:121)
at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsHibernateUtil.configureHibernateDomainClasses(GrailsHibernateUtil.java:81)
at org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.newSessionFactory(ConfigurableLocalSessionFactoryBean.java:119)
Please see attached file to reproduce the error. Simply unzip and run "grails run-app"
-
Hide
- MixedMappingIssues.zip
- 17/Aug/09 2:49 PM
- 245 kB
- Jonathan Koppenhofer
-
- MixedMappingIssues/.classpath 6 kB
- MixedMappingIssues/.project 0.5 kB
- MixedMappingIssues/.../org.codehaus.groovy.eclipse.preferences.prefs 0.1 kB
- MixedMappingIssues/application.properties 0.2 kB
- MixedMappingIssues/build.xml 5 kB
- MixedMappingIssues/.../BootStrap.groovy 0.1 kB
- MixedMappingIssues/.../Config.groovy 3 kB
- MixedMappingIssues/.../DataSource.groovy 0.6 kB
- MixedMappingIssues/.../hibernate.cfg.xml 0.4 kB
- MixedMappingIssues/.../Phone.hbm.xml 0.4 kB
- MixedMappingIssues/.../resources.groovy 0.0 kB
- MixedMappingIssues/.../UrlMappings.groovy 0.2 kB
- MixedMappingIssues/.../Contact.groovy 0.1 kB
- MixedMappingIssues/.../messages.properties 3 kB
- MixedMappingIssues/.../messages_de.properties 3 kB
- MixedMappingIssues/.../messages_es.properties 3 kB
- MixedMappingIssues/.../messages_fr.properties 2 kB
- MixedMappingIssues/.../messages_it.properties 2 kB
- MixedMappingIssues/.../messages_ja.properties 2 kB
- MixedMappingIssues/.../messages_nl.properties 3 kB
- MixedMappingIssues/.../messages_pt_BR.properties 3 kB
- MixedMappingIssues/.../messages_ru.properties 4 kB
- MixedMappingIssues/.../messages_th.properties 5 kB
- MixedMappingIssues/.../messages_zh_CN.properties 2 kB
- MixedMappingIssues/grails-app/.../error.gsp 2 kB
- MixedMappingIssues/grails-app/.../index.gsp 0.9 kB
- MixedMappingIssues/grails-app/.../main.gsp 0.7 kB
- MixedMappingIssues/ivy.xml 2 kB
- MixedMappingIssues/ivysettings.xml 0.8 kB
- MixedMappingIssues/MixedMappingIssues-test.launch 0.8 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
This error no longer occurs, but another one does in your example:
Caused by: org.hibernate.MappingException: Could not determine type for: test.Phone, at table: contact, for columns: [org.hibernate.mapping.Column(phone)]
This is because you have an association from your Hibernate mapped class to your GORM domain. Relationships between GORM and hibernate mapped entities don't really work and would take a significant re-write of the ORM binding to support both, which certainly won't make it into 1.2
I just hit this not knowing it wasn't possible. My Grails project is pulling in a large java code base. Up until this point, the java integration (spring, hibernate, controllers, etc) all worked great. Hitting the wall at the last step (connecting grails domain with java domain) was a crushing defeat. ![]()
I'd just like to add my support for getting this feature into Grails. Pretty please ![]()
Damn it!
I just hit it as well!
I have to have a class using Hibernate Annotations as I have to have a custom @SQLInsert query :/
Is there any chance for this to be fixed? And applied to 1.3.7?
Damn ... :/
This is required for Postgres Partitioning to work properly ...
This may be related to issue GRAILS-4193