我根据此网站配置了二级缓存 http://www.cnblogs.com/iloveu/archive/2009/02/16/1391392.html
现在报出
[code="java"]1.%%%% Error Creating SessionFactory %%%%
2.org.hibernate.MappingException: invalid configuration
3. at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2241)
4. at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:230)
5. at org.hibernate.cfg.AnnotationConfiguration.doConfigure(AnnotationConfiguration.java:71)
6. at org.hibernate.cfg.Configuration.configure(Configuration.java:2158)
7. at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:212)
8. at org.hibernate.cfg.AnnotationConfiguration.configure(AnnotationConfiguration.java:71)
9. at com.huawei.ifree.autotest.log.analyse.platform.db.HibernateSessionFactory.updateHibernateCfg(HibernateSessionFactory.java:62)
10. at com.huawei.ifree.autotest.log.analyse.platform.db.HibernateSessionFactory.(HibernateSessionFactory.java:44)
11. at com.huawei.ifree.autotest.log.analyse.platform.servlet.ActivatorServlet.init(ActivatorServlet.java:53)
12. at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
13. at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
14. at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4187)
15. at org.apache.catalina.core.StandardContext.start(StandardContext.java:4496)
16. at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
17. at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
18. at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
19. at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
20. at org.apache.catalina.core.StandardService.start(StandardService.java:519)
21. at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
22. at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
23. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
24. at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
25. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
26. at java.lang.reflect.Method.invoke(Unknown Source)
27. at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
28. at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
29.Caused by: org.xml.sax.SAXParseException: The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collection-cache)*,event*,listener*)".
30. at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)
31. at org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:173)
32. at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:371)
33. at org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:305)
34. at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:1918)
35. at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:851)
36. at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1008)
37. at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
38. at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
39. at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
40. at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
41. at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
42. at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
43. at org.dom4j.io.SAXReader.read(SAXReader.java:465)
44. at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2238)
45. ... 25 more
[/code]
hibernate缓存问题
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
10条回答 默认 最新
- myali88 2011-08-09 18:59关注
[quote]查询缓存是直接缓存已经执行的那一条sql语句吗? 如果下次碰到语句一样的, 就到缓存里面去找吗?[/quote]
对啊,查询条件都要一样。本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 关于#vscode#的问题:ESP32开发板对接MQTT实现小灯泡的开关
- ¥15 TMC2209串口模式下读取不到寄存器的值串口助手蓝色字体是发过去的消息,绿色字体是收到的消息,第二行发送读取寄存器的指令但是没有读取到寄存器的值串口助手如下图:接线如下图,如何解决?
- ¥15 高通安卓11提取完整线刷包软件,或者优博讯dt50顺丰刷机包
- ¥20 C,有个译码器,换了信道就跑不出原来数据
- ¥15 MIMIC数据库安装问题
- ¥60 基于JTag协议开发Fpga下载器上位机,哪位大🐂有偿指导?
- ¥20 全书网Java爬取数据
- ¥15 怎么获取红包封面的原始链接,并且获取红包封面序列号
- ¥100 微信小程序跑脚本授权的问题
- ¥100 房产抖音小程序苹果搜不到安卓可以付费悬赏