Web应用程序结构层次问题
下面是我的项目层次结构的插图
项目层次结构http://a.yfrog.com/img809/3151/58400945.png
当我尝试将我的file_name.java文件连接到休眠时,我遇到了这些错误
Exception in thread "main" org.hibernate.HibernateException: Could not instantiate cache implementation
at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:214)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at net.pkg.dao.FirstExample.main(FirstExample.java:17)
Caused by: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
at org.hibernate.cache.NoCacheProvider.buildCache(NoCacheProvider.java:21)
at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:61)
问题与我的hibernate.cfg.xml
有关...但我无法解决它。有任何想法吗?
没有找到相关结果
已邀请:
1 个回复
程琶
或
而没有激活第二级缓存,因此错误信息:
你需要在
中使用二级缓存(我在这里使用EHCache作为缓存提供者):
是否真的需要二级缓存是另一个故事。