2014-05-25 11 views
6

I stworzył nową aplikację przy użyciu Grails 2.4.0, a następnie przy zmianie wtyczki do hibernacji: hibernacji: 3.6.10.15, mam następujący błąd:Błąd w Grails 2.4.0 z hibernacji: 3.6.10.15 wtyczki

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 

Uwaga: Zmieniono wtyczkę trybu hibernacji (z hibernacji4: 4.3.5.3 na hibernację: 3.6.10.15), aby rozwiązać problem wyświetlony po uruchomieniu s2-quickstart podczas instalacji spring-security-core: 2.0- RC3

Czy to błąd w nowym wydaniu, czy coś mi brakuje?

+1

w twoim conf/DataSource.groovy, która wersja hibernacji jest aktywna? –

+0

dziękuję fat_mike, nie wiem, że istnieje odpowiedni parametr w źródle danych do zmiany. – Ayman

Odpowiedz

15

Twój conf/DataSource.groovy hibernacji sekcja powinna wyglądać następująco:

hibernate { 
    cache.use_second_level_cache = true 
    cache.use_query_cache = false 
    cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3 
//cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4 
    singleSession = true // configure OSIV singleSession mode 
} 

Jeśli włączono hibernację 3 w BuildConfig.groovy należy wykomentuj cache hibernacji 4 w DataSource.groovy i włączyć cache hibernacja 3.

Powiązane problemy