Resource: bean/Product.hbm.xml not found

前端之家收集整理的这篇文章主要介绍了Resource: bean/Product.hbm.xml not found前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

错误为在hibernate.cfg.xml文件中没有发现中的Product.hbm.xml文件

org.hibernate.MappingException: Resource: bean/Product.hbm.xml not found
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:479)
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
    at util.HibernateSessionFactory.<clinit>(HibernateSessionFactory.java:19)
Could not read mappings from resource: bean/Customer.hbm.xml
org.hibernate.MappingException: Could not read mappings from resource: bean/Customer.hbm.xml
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:485)
    at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
    at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
    at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
    at org.hibernate.cfg.Configuration.configure(Configuration.java:1310)
    at util.HibernateSessionFactory.rebuildSessionFsactory(HibernateSessionFactory.java:46)
    at util.HibernateSessionFactory.getSession(HibernateSessionFactory.java:34)
    at util.HibernateSessionFactory.main(HibernateSessionFactory.java:79)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping bean.Customer
    at org.hibernate.cfg.Mappings.addClass(Mappings.java:118)
    at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:154)
    at org.hibernate.cfg.Configuration.add(Configuration.java:386)
    at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
    at org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
    ... 8 more
原文链接:https://www.f2er.com/xml/295629.html

猜你在找的XML相关文章