org.hibernate.InvalidMappingException:Could not parse mapping document from resource com/lara/Person.hbm.xml

前端 未结 4 760
时光取名叫无心
时光取名叫无心 2020-12-12 01:35
Exception in thread \"main\" org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/lara/Person.hbm.xml
    at org.hibernate.cfg.C         


        
4条回答
  •  一向
    一向 (楼主)
    2020-12-12 02:01

    The error message says (buried in a big stack trace):

    Document root element "hibernate-mapping", must match DOCTYPE root "hibernate-configuration"
    

    This is because in your Person.hbm.xml file, you have

    
    

    where you should probably have

    
    

    This DOCTYPE has to match the root tag.

提交回复
热议问题