首页 > 学院 > 开发设计 > 正文

Hibernate空指针异常

2019-11-06 07:43:37
字体:
来源:转载
供稿:网友

今天写hibernate的时候,发现一个头痛的问题,一直报错空指针异常,检查了好几遍没有问题啊,

后来发现原来是hibernate.cfg.xml中的mapping映射是区分大小写的,写错就会报空指针异常

原来<mapping resource="com/mr/mycrowded/mycrowded.hbm.xml"/>

改为<mapping resource="com/mr/mycrowded/Mycrowded.hbm.xml"/>


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表