生成表结构出错,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

来源:1-6 生成表结构

qq_天空之城_19

2017-04-06 15:45

Students.hbm.xml文件存在;

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

写回答 关注

1回答

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

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

    lobigo

    最后.xml后面多了个s,不好意思

    2017-04-06 16:54:02

    共 1 条回复 >

使用Struts2+Hibernate开发学生信息管理功能

Strust2+Hibernate整合开发案例,Java Web开发技能更上一层楼

80695 学习 · 797 问题

查看课程

相似问题