I get this error on startup grails run-app:
Error during bootstrap: error while creating bean named 'messageSource': Initialization of bean failed; nested exception org.springframework.beans.factory.BeanCreationException: error creating a bean named "transactionManager": cannot resolve the link to bean 'sessionFactory' when setting the bean 'sessionFactory' property; org.springframework.beans.factory.BeanCreationException nested exception: error creating a bean named "sessionFactory": cannot resolve the bean link 'hibernateProperties' when setting the bean'hibernateProperties' property; nested exception org.springframework.beans.factory.BeanCreationException: error creating a bean named "hibernateProperties": cannot resolve the reference to bean 'dialectDetector'when setting the "properties" bean property with the key [hibernate.dialect]; nested exception org.springframework.beans.factory.BeanCreationException: error creating bean named 'dialectDetector': init method call failed; nested exception org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Failed to determine hibernation dialect for database name [H2]!
Relevant DataSource.groovy :
dataSource {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
hibernate {
cache.use_second_level_cache = true
cache.use_query_cache = true
cache.provider_class = 'net.sf.ehcache.hibernate.EhCacheProvider'
}
environments {
development {
dataSource {
dbCreate = "create-drop"
url = "jdbc:h2:mem:devDB"
}
}
test {
production {
}
When I explicitly provide the dialect as above ( org.hibernate.dialect.H2Dialect), this error occurs:
: bean 'messageSource': bean ; - org.springframework.beans.factory.BeanCreationException: bean "transactionManager": bean "sessionFactory" bean "sessionFactory"; - org.springframework.beans.factory.BeanCreationException: bean "sessionFactory": init ; - java.lang.IncompatibleClassChangeError: org.hibernate.cfg.Mappings,
- , ?
( http://jira.grails.org/browse/GRAILS-7994)