异常org.hibernate.DuplicateMappingException问题解决方案

异常org.hibernate.DuplicateMappingException

项目启动控制台报错:

org.hibernate.DuplicateMappingException: duplicate import: NewQuotationSchedule refers to both org.hpin.quotation.entity.NewQuotationSchedule and org.hpin.newDecoration.entity.NewQuotationSchedule (try using auto-import="false")

主要问题是tomcat 加载实体类时出现同样的类名,导致无法加载

解决方法:

在实体类的 NewQuotationSchedule.hbm.xml
hibernate-mapping标签栏里添加 auto-import=“false”

<hibernate-mapping auto-import="false" >

如下图
在这里插入图片描述
能解决问题

猜你喜欢

转载自blog.csdn.net/u013478983/article/details/112559172