您的位置:首页 > 其它

hibernate配置二级缓存出现的问题

2012-01-13 15:56 344 查看
我在配置二级缓存的时候出现了这样的问题,请大家给看看那啊

Exception in thread "main" java.lang.ExceptionInInitializerError

at cn.sjg.hibernate.CacheTest.addUser(CacheTest.java:32)

at cn.sjg.hibernate.CacheTest.main(CacheTest.java:19)

Caused by: org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge]

at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:423)

at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:280)

at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2863)

at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2859)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1870)

at cn.sjg.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:23)

... 2 more

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:409)

... 7 more

Caused by: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory

at com.opensymphony.oscache.base.Config.<clinit>(Config.java:23)

at org.hibernate.cache.OSCacheProvider.<clinit>(OSCacheProvider.java:55)

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 java.lang.Class.newInstance0(Class.java:355)

at java.lang.Class.newInstance(Class.java:308)

at org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge.<init>(RegionFactoryCacheProviderBridge.java:63)

... 12 more

Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory

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)

... 21 more

谢谢大家啦啊
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: