xiaochengfu1
xiaochengfu1
2011-08-09 16:58

hibernate缓存问题

  • hibernate

我根据此网站配置了二级缓存 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]

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

10条回答

为你推荐

换一换