【发布时间】:2014-07-14 07:38:51
【问题描述】:
我使用 grails 2.4.0 创建了一个新应用,然后将 hibernate 插件更改为 :hibernate:3.6.10.15 时,出现以下错误:
Error |
2014-05-25 12:37:52,167 [localhost-startStop-1] ERROR context.Grail
actionManagerPostProcessor': Initialization of bean failed; nested
e 'transactionManager': Cannot resolve reference to bean 'sessionFa
.factory.BeanCreationException: Error creating bean with name 'sess
n: could not instantiate RegionFactory [org.hibernate.cache.ehcache
Message: Error creating bean with name 'transactionManagerPostProce
eationException: Error creating bean with name 'transactionManager'
nested exception is org.springframework.beans.factory.BeanCreationE
exception is org.hibernate.HibernateException: could not instantia
Line | Method
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Wor
^ 744 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'tra
essionFactory'; nested exception is org.springframework.beans.facto
d failed; nested exception is org.hibernate.HibernateException: cou
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Wor
^ 744 | run in java.lang.Thread
Caused by BeanCreationException: Error creating bean with name 'ses
on: could not instantiate RegionFactory [org.hibernate.cache.ehcach
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Wor
^ 744 | run in java.lang.Thread
Caused by HibernateException: could not instantiate RegionFactory [
->> 262 | run in java.util.concurrent.FutureTask
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run . . . in java.util.concurrent.ThreadPoolExecutor$Wor
^ 744 | run in java.lang.Thread
Caused by ClassNotFoundException: org.hibernate.cache.ehcache.EhCac
->> 366 | run in java.net.URLClassLoader$1
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
| 355 | run in ''
| 354 | findClass in java.net.URLClassLoader
| 425 | loadClass in java.lang.ClassLoader
| 190 | forName . in java.lang.Class
| 262 | run in java.util.concurrent.FutureTask
| 1145 | runWorker in java.util.concurrent.ThreadPoolExecutor
| 615 | run in java.util.concurrent.ThreadPoolExecutor$Wor
^ 744 | run . . . in java.lang.Thread
| Error Forked Grails VM exited with error
注意:我已更改 hibernate 插件(从 hibernate4:4.3.5.3 到 hibernate:3.6.10.15)以解决在安装 spring-security-core:2.0-RC3 期间运行 s2-quickstart 后出现的错误
这是新版本中的错误还是我遗漏了什么?
【问题讨论】:
-
在您的 conf/DataSource.groovy 中哪个休眠版本处于活动状态?
-
谢谢fat_mike,不知道datasource里面有没有对应的参数要改。