Exception in thread "main" org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/boco/hibernate/model/Student.hbm.xml
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3415)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXmlQueue(Configuration.java:3404)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3392)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1341)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737)
at studentTest.main(studentTest.java:22)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping com.boco.hibernate.model.Student
at org.hibernate.cfg.Configuration$MappingsImpl.addClass(Configuration.java:2580)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:174)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processHbmXml(Configuration.java:3412)
... 5 more
742 阅读
检查Student.hbm.xml 是否有问题。
Hibernate4和3的区别参考以下文章:
http://blog.sina.com.cn/s/blog_3e20fc040100yhzq.html
http://www.cnblogs.com/hibernate6/
引用来自“Wentasy”的答案
检查Student.hbm.xml 是否有问题。
Hibernate4和3的区别参考以下文章:
http://blog.sina.com.cn/s/blog_3e20fc040100yhzq.html
http://www.cnblogs.com/hibernate6/