问题描述
log4j:WARNNoappenderscouldbefoundforlogger(org.hibernate.cfg.Environment).log4j:WARNPleaseinitializethelog4jsystemproperly.Exceptioninthread"main"org.hibernate.InvalidMappingException:Couldnotparsemappingdocumentfromresourcecom/my/hibernate/test/Stuinfo.hbm.xmlatorg.hibernate.cfg.Configuration.addResource(Configuration.java:616)atorg.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1635)atorg.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1603)atorg.hibernate.cfg.Configuration.doConfigure(Configuration.java:1582)atorg.hibernate.cfg.Configuration.doConfigure(Configuration.java:1556)atorg.hibernate.cfg.Configuration.configure(Configuration.java:1476)atorg.hibernate.cfg.Configuration.configure(Configuration.java:1462)atcom.my.dao.TestHibernate.<init>(TestHibernate.java:14)atcom.my.dao.TestHibernate.main(TestHibernate.java:31)Causedby:org.hibernate.InvalidMappingException:Couldnotparsemappingdocumentfrominputstreamatorg.hibernate.cfg.Configuration.addInputStream(Configuration.java:555)atorg.hibernate.cfg.Configuration.addResource(Configuration.java:613)...8moreCausedby:org.dom4j.DocumentException:hibernate.sourceforge.netNestedexception:hibernate.sourceforge.netatorg.dom4j.io.SAXReader.read(SAXReader.java:484)atorg.hibernate.cfg.Configuration.addInputStream(Configuration.java:546)...9more给点提示:
解决方案
解决方案二:
Couldnotparsemappingdocumentfromresource无法从资源解析映射文件
解决方案三:
com/my/hibernate/test/Stuinfo.hbm.xml这个文件写的有问题吧
解决方案四:
要什么提示?提示你自己都贴出来了!
解决方案五:
错误都指向了你那个实体的配置文件了