【发布时间】:2016-04-08 17:35:57
【问题描述】:
我正在将 oracle 从 10 升级到 12,对于这个特定的项目,我收到了这个错误:
<[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1460078994317> <BEA-101162> <User defined listener org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': 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': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [Oracle]!.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManagerPostProcessor': 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': Cannot resolve reference to bean 'hibernateProperties' while setting bean property 'hibernateProperties'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateProperties': Cannot resolve reference to bean 'dialectDetector' while setting bean property 'properties' with key [hibernate.dialect]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dialectDetector': Invocation of init method failed; nested exception is org.codehaus.groovy.grails.orm.hibernate.exceptions.CouldNotDetermineHibernateDialectException: Could not determine Hibernate dialect for database name [Oracle]!
似乎无法识别我在 DataSource 上添加的配置:
dataSource {
pooled = true
driverClassName = "oracle.jdbc.OracleDriver"
dialect = "org.hibernate.dialect.Oracle10gDialect"
}
我们使用的是 Java 8,并且我们对代码有这些依赖项:
runtime 'com.oracle:ojdbc7:12.1.0.2'
runtime(group: 'com.oracle', name: 'ons', version: '10.2.0.3')
问题是它正在为另一个项目工作(与这个具有相同的结构,但由于某种原因它在这里不起作用)
有什么遗漏或者我可以找到问题并解决问题吗?
【问题讨论】:
-
Grails 和 Hibernate 有哪些版本?
-
你为什么不使用 Oracle 12C aka org.hibernate.dialect.Oracle12cDialect 的休眠方言?
-
还要确保使用与您的 oracle 版本完全匹配的 jdbc 驱动程序