Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xml%%%% Error Creating SessionFactory %%%%org.hibernate.MappingException:Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xmlCaused by:org.hibernate.Dupl

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/03 05:58:02
Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xml%%%% Error Creating SessionFactory %%%%org.hibernate.MappingException:Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xmlCaused by:org.hibernate.Dupl

Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xml%%%% Error Creating SessionFactory %%%%org.hibernate.MappingException:Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xmlCaused by:org.hibernate.Dupl
Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xml
%%%% Error Creating SessionFactory %%%%
org.hibernate.MappingException:Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xml
Caused by:org.hibernate.DuplicateMappingException:Duplicate class/entity mapping com.sooyie.hibernate.orm.Admin
tomcat 启动后报错 报的两个错很郁闷 请教具体原因
HIBERNATE.CFG.XML配置文件中 导入的实体类的映射文件确定是正确的 因为该项目在其他机子上部署是没问题的
实体类配置文件中的类和属性这些映射也都正确
Admin 实体也未重复定义 这些问题我在提问之前都检查过了的
不过现在问题已经解决了 我换了个版本的tomcat 重新部署 具体原因还是没找见!

Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xml%%%% Error Creating SessionFactory %%%%org.hibernate.MappingException:Could not read mappings from resource:com/sooyie/hibernate/orm/Admin.hbm.xmlCaused by:org.hibernate.Dupl
你首先查下你的HIBERNATE.CFG.XML配置文件中 导入的实体类的映射文件是否正确配置好了
再检查实体类配置文件中的类和属性这些映射是否配置正确
你报的这个错是重复定义了实体类com.sooyie.hibernate.orm.Admin