How do I avoid 'Could not determine Hibernate dialect for database name [H2]!'?

后端 未结 5 2057
情歌与酒
情歌与酒 2020-12-12 01:46

I am getting this error when running grails run-app:

Error executing bootstraps: Error creating bean with name \'messageSource\': Initi

5条回答
  •  悲哀的现实
    2020-12-12 02:23

    Which version of Grails are you using? I believe you are using Grails 1.3.7.

    The H2Dialet has a few bugs from the Hibernate.jar which is 3.3.1 in Grails 1.3.7, it is included in Hibernate 3.5 and Grails 2.0.

    My solution is, in your DataSource.groovy, use this

    dialect='org.hibernate.dialect.H2DialectPatch'
    

    and download the Java class from here : Source Code, change its class name to H2DialectPatch to avoid confusing, put it in your src/java folder.

提交回复
热议问题