为了账号安全,请及时绑定邮箱和手机立即绑定

运行test显示下列错误,求高手解答

八月 19, 2016 10:25:14 上午 org.hibernate.annotations.common.Version <clinit>

INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}

八月 19, 2016 10:25:14 上午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {4.2.21.Final}

八月 19, 2016 10:25:14 上午 org.hibernate.cfg.Environment <clinit>

INFO: HHH000206: hibernate.properties not found

八月 19, 2016 10:25:14 上午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

八月 19, 2016 10:25:14 上午 org.hibernate.cfg.Configuration configure

INFO: HHH000043: Configuring from resource: /hibernate.cfg.xml

八月 19, 2016 10:25:14 上午 org.hibernate.cfg.Configuration getConfigurationInputStream

INFO: HHH000040: Configuration resource: /hibernate.cfg.xml

八月 19, 2016 10:25:15 上午 org.hibernate.cfg.Configuration addResource

INFO: HHH000221: Reading mappings from resource: com/imooc/entity/Grade.hbm.xml

Exception in thread "main" java.lang.ExceptionInInitializerError

at com.imooc.util.test.add(test.java:25)

at com.imooc.util.test.main(test.java:13)

Caused by: org.hibernate.MappingNotFoundException: resource: com/imooc/entity/Grade.hbm.xml not found

at org.hibernate.cfg.Configuration.addResource(Configuration.java:740)

at org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:2197)

at org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:2169)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2149)

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:2102)

at org.hibernate.cfg.Configuration.configure(Configuration.java:2017)

at org.hibernate.cfg.Configuration.configure(Configuration.java:1996)

at com.imooc.util.HibernateUtil.<clinit>(HibernateUtil.java:19)

... 2 more


正在回答

1 回答

原来忘记命名Package包了

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
Hibernate初探之一对多映射
  • 参与学习       42171    人
  • 解答问题       295    个

Hibernate中一对多关联映射配置,以及cascade和inverse属性作用

进入课程

运行test显示下列错误,求高手解答

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信