当前位置: 代码迷 >> Java相关 >> Caused by: org.hibernate.cache.CacheException: could not instantiate
  详细解决方案

Caused by: org.hibernate.cache.CacheException: could not instantiate

热度:6988   发布时间:2013-02-25 21:50:30.0
hibernate异常
Java code
Exception in thread "main" org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]    at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:389)    at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:262)    at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2119)    at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2115)    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1339)    at StudentTest.main(StudentTest.java:16)Caused by: java.lang.reflect.InvocationTargetException    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)    at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:384)    ... 5 moreCaused by: org.hibernate.cache.CacheException: could not instantiate CacheProvider [org.hibernate.cache.internal.NoCacheProvider]    at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:66)    ... 10 moreCaused by: java.lang.ClassNotFoundException: org.hibernate.cache.internal.NoCacheProvider    at java.net.URLClassLoader$1.run(URLClassLoader.java:200)    at java.security.AccessController.doPrivileged(Native Method)    at java.net.URLClassLoader.findClass(URLClassLoader.java:188)    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)    at java.lang.ClassLoader.loadClass(ClassLoader.java:252)    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)    at java.lang.Class.forName0(Native Method)    at java.lang.Class.forName(Class.java:169)    at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192)    at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:63)    ... 10 more




请问这是什么异常呢???

------解决方案--------------------------------------------------------
加上这个包 ehcache.jar 


------解决方案--------------------------------------------------------
commons-logging-1.0.4.jar
------解决方案--------------------------------------------------------
Caused by: java.lang.ClassNotFoundException: org.hibernate.cache.EhcheProvider 

额。是不是你配置错了吧、

应该是这个类 org.hibernate.cache.EhCacheProvider
------解决方案--------------------------------------------------------
aused by: java.lang.ClassNotFoundException: org.hibernate.cache.internal.NoCacheProvide
没这个类,去网上http://www.jar114.com/找这个类,下载该类所在的包
如果还是出错,看看还缺了什么包,再去下,如果不是由于缺少类儿导致的错误,那可能是你的配置或者是别的错误
  相关解决方案