2014-05-25 14 views
6

मैं grails 2.4.0 का उपयोग कर एक नया एप्लिकेशन बनाया, तो जब को हाइबरनेट प्लगइन बदल रहा है: हाइबरनेट:त्रुटि: 3.6.10.15 प्लगइन

: 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 

नोट: मैंने स्प्रिंग-सुरक्षा-कोर स्थापित करने के दौरान s2-quickstart चलाने के बाद एक त्रुटि को हल करने के लिए आसपास के काम के रूप में हाइबरनेट 4: 4.3.5.3 से हाइबरनेट: 3.6.10.15) को हाइबरनेट प्लगइन बदल दिया है: 2.0- आरसी 3

क्या यह नई रिलीज में एक बग है या मुझे कुछ याद आ रहा है?

+1

आपके conf/DataSource.groovy में जो हाइबरनेट संस्करण सक्रिय है? –

+0

धन्यवाद fat_mike, मुझे नहीं पता कि डेटासोर्स में एक समान पैरामीटर बदलना है। – Ayman

उत्तर

15

आपका conf/DataSource.groovy हाइबरनेट अनुभाग इस तरह दिखना चाहिए:

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 
} 

आप BuildConfig.groovy में हाइबरनेट 3 सक्षम किया है आप DataSource.groovy में हाइबरनेट 4 का कैश बाहर टिप्पणी करना चाहिए और का कैश सक्षम हाइबरनेट 3.

संबंधित मुद्दे