问答详情
源自:1-6 生成表结构

生成表结构出错,org.hibernate.MappingNotFoundException: resource: entity.Students.hbm.xml not found at org.hibernate.cfg.Configuration.addResource(Configuration.java:738) at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2188) at org.hi

Students.hbm.xml文件存在;

配置文件hibernate.cfg.xml有加<mapping resource="Stdents.hbm.xml"/>

提问者:qq_天空之城_19 2017-04-06 15:45

个回答

  • lobigo
    2017-04-06 16:52:20

    这个错误是生成表的映射文件没有找到引起的,相对于hibernate.cfg.xml文件来说,你写的<mapping resource="Stdents.hbm.xml"/>路径是找不到Students.hbm.xml文件的,建议使用绝对路径,改为<mapping resource="entity/Students.hbm.xmls"/>