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

SessionFactory为空

http://img1.sycdn.imooc.com//59706d350001c72013130593.jpg

具体错误如下:

七月 20, 2017 4:30:20 下午 org.hibernate.annotations.common.Version <clinit>

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

七月 20, 2017 4:30:20 下午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {4.2.4.Final}

七月 20, 2017 4:30:20 下午 org.hibernate.cfg.Environment <clinit>

INFO: HHH000206: hibernate.properties not found

七月 20, 2017 4:30:20 下午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

七月 20, 2017 4:30:20 下午 org.hibernate.cfg.Configuration configure

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

七月 20, 2017 4:30:20 下午 org.hibernate.cfg.Configuration getConfigurationInputStream

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

七月 20, 2017 4:30:20 下午 org.hibernate.cfg.Configuration addResource

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

七月 20, 2017 4:30:20 下午 org.hibernate.cfg.Configuration addResource

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

七月 20, 2017 4:30:20 下午 org.hibernate.cfg.Configuration doConfigure

INFO: HHH000041: Configured SessionFactory: null

Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.integrator.internal.IntegratorServiceImpl.<init>(Ljava/util/LinkedHashSet;Lorg/hibernate/boot/registry/classloading/spi/ClassLoaderService;)V

at org.hibernate.boot.registry.BootstrapServiceRegistryBuilder.build(BootstrapServiceRegistryBuilder.java:207)

at org.hibernate.boot.registry.StandardServiceRegistryBuilder.<init>(StandardServiceRegistryBuilder.java:69)

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

at com.imooc.test.Test1.add(Test1.java:36)

at com.imooc.test.Test1.main(Test1.java:17)


正在回答

1 回答

已解决,Hibernate jar包导入版本有问题。我没有用老师的,用的是自己以前的Hibernate

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

举报

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

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

进入课程

SessionFactory为空

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