qq_29401363
qq_29401363
2018-03-28 12:16
采纳率: 100%
浏览 11.2k
已采纳

Spring boot entityManagerFactory Bean

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-03-28 20:03:54.708 ERROR 11400 --- [ main] o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [com/wangyonglin/configuration/DataSourceConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean]: Factory method 'entityManagerFactory' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/Session
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:587) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1250) ~[spring-beans-5.0.4.RELEASE.jar:5.0.4.RELEASE]


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • weixin_37509652
    爪哇岛上抓娃娃 2018-03-29 01:36
    已采纳

    可以打开jar包的依赖图,红线的话表示有冲突,可以不写版本号,也可以让提示选择版本。。然后点击刷新jar包~

    点赞 评论
  • caozhy
    点赞 评论
  • qq_29401363
    qq_29401363 2018-03-29 09:29

    谢谢你们,第一次学写java 还没有一个星期,为了这个问题看了好多资料,谢谢你们,我看过你们的回答才启示我,原因问题是springboot 版本问题我用的是2.0.0被我写为1.5.3就过了谢谢你们

    点赞 评论

相关推荐