惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

罗磊的独立博客
Cisco Talos Blog
Cisco Talos Blog
C
Check Point Blog
博客园_首页
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Martin Fowler
Martin Fowler
Recorded Future
Recorded Future
S
Security @ Cisco Blogs
L
LINUX DO - 最新话题
博客园 - 司徒正美
P
Privacy International News Feed
G
Google Developers Blog
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Scott Helme
Scott Helme
K
Kaspersky official blog
I
InfoQ
Y
Y Combinator Blog
T
The Blog of Author Tim Ferriss
Webroot Blog
Webroot Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
大猫的无限游戏
大猫的无限游戏
D
Docker
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Microsoft Azure Blog
Microsoft Azure Blog
Spread Privacy
Spread Privacy
量子位
H
Hacker News: Front Page
Simon Willison's Weblog
Simon Willison's Weblog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
SecWiki News
SecWiki News
S
Security Affairs
Latest news
Latest news
人人都是产品经理
人人都是产品经理
C
CERT Recently Published Vulnerability Notes
S
Security Archives - TechRepublic
V
Visual Studio Blog
T
Troy Hunt's Blog
S
Secure Thoughts
F
Fortinet All Blogs
V
V2EX
The Register - Security
The Register - Security
J
Java Code Geeks
MongoDB | Blog
MongoDB | Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO

博客园 - GeneralXU

股市量化智能分析2035 忘记mysql root密码的解决方法 Mule 官方例子研究 开源企业服务总线ESB汇总与对比 Apache CXF 介绍 JAX-WS eclipse.ini/myeclipse.ini文件中参数配置 Web2.0是什么:下一代软件的业务模式与设计模式 FaceBook网站架构软件揭秘 概念介绍:OLAP和ROLAP,MOLAP,HOLAP Oracle WebCenter 11g 快速开发指南--翻译(三) J2EE框架(TomcatStrutsHibernateSpringAjax(dojo))开发步骤 Oracle WebCenter 11g 快速开发指南--翻译(二) 《人月神话》--摘录 Oracle WebCenter 11g 快速开发指南--翻译(一) ORACLE11G 字符集更改(这里更改为AL32UTF8) oracle 11g登录密码问题 C# Media Player控件(转) java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter 异常解决办法
hibernate -----Could not instantiate cache implementation异常处理(转) - GeneralXU
GeneralXU · 2010-12-28 · via 博客园 - GeneralXU

  大概意思是二级缓存不可用,但是项目在开发阶段不需要启动缓存,所以就没有配置。
最后发现问题就是在这里,因为在Hibernate的bean的hbm配置文件中配置了缓存,而在hibernate的配置中没有配置提供的缓存机制,在早起的hibernate的早起版本中默认是提供ehcache的,但是在最近的版本中已经不提供默认配置了。所以必须自己手工配置。在hibernate的配置中加入如下片段即可

<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>

        <!-- Hibernate二级缓存配置,把sessionFactory交给spring管理(例如开事务、提交事务等) -->
        <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
         <property name="dataSource" ref="dataSource"/><!-- 把dataSource数据源注入到dataSource属性中 -->
         <property name="mappingResources">
            <list>
                 <!-- Hibernate映射元数据,可以有多个 -->
           <value>cn/general/bean/Person.hbm.xml</value>
          </list>
         </property>
         <property name="hibernateProperties"><!-- 配置Hibernate的属性信息 -->
          <value>
           hibernate.dialect=org.hibernate.dialect.Oracle9Dialect
           hibernate.hbm2ddl.auto=update
           hibernate.show_sql=false
           hibernate.format_sql=false
           hibernate.cache.use_second_level_cache=true
           hibernate.cache.use_query_cache=false
           hibernate.cache.provider_class=org.hibernate.cache.EhCacheProvider
          </value>
         </property>
        </bean>