【问题标题】:NoSuchMethod error using springboot 1.2.2 Release with spring security oauth 2.0.7 ReleaseNoSuchMethod 错误使用 springboot 1.2.2 Release 和 spring security oauth 2.0.7 Release
【发布时间】:2015-09-03 20:00:40
【问题描述】:

我用的是springboot版本:

 <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.2.RELEASE</version>
</parent

在我正在使用 spring security oauth 2.0.7 版本的另一个项目中:

<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.7.RELEASE</version>

第二个 oauth 项目被添加为父项目的依赖项。 两个项目都成功构建。 但是在应用程序启动时出现以下错误:

java.lang.NoSuchMethodError: org.springframework.beans.factory.support.DefaultListableBeanFactory.isAllowEagerClassLoading()Z
at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.get(BeanTypeRegistry.java:147)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:158)
at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:147)

【问题讨论】:

    标签: spring oauth spring-security spring-boot


    【解决方案1】:

    您正在尝试使用不符合 Spring Boot 要求的 Spring Framework 版本。

    作为described in the documentation,Spring Boot 1.2.2 需要 Spring Framework 4.1.3 或更高版本。 isAllowEagerClassLoading 在 Spring Framework 4.1.2 中添加到 DefaultListableBeanFactory,因此您必须使用 4.1.1 或更早版本。

    理想情况下,您应该删除 Spring Framework 依赖项版本的任何手动配置,并允许从 spring-boot-starter-parent 继承的依赖项管理进行控制。否则,您应该手动指定兼容版本。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-10-11
      • 2016-11-07
      • 2015-06-01
      • 2018-04-12
      • 1970-01-01
      • 2019-01-03
      • 1970-01-01
      • 2015-03-19
      相关资源
      最近更新 更多