Receiver class o.s.c.b.BootstrapApplicationListener$CloseContextOnFailureApplicationListener does not define or inherit an impl

前端 未结 3 670
时光取名叫无心
时光取名叫无心 2021-01-25 01:54

I\'m facing this error while running the project. I\'m unable to know the cause of the error and unable to find a solution online as well. This project is running over another l

相关标签:
3条回答
  • 2021-01-25 02:32

    This is because of spring and cloud version not compatible.

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

    The version of the parent should be an upgrade one or the same as cloud version.

    <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-oauth2</artifactId>
    <version>2.1.3.RELEASE</version>
    </dependency>
    
    0 讨论(0)
  • 2021-01-25 02:41

    Your Spring Boot version is too old for your Spring Cloud version:

    https://github.com/spring-cloud/spring-cloud-commons/issues/552

    Spring Cloud Greenwich (2.1.x) is not compatible with spring boot 2.0.x and spring framework 5.0.x. Either update spring boot or downgrade spring cloud to Finchley.

    So please update Spring Boot to 2.1.x

    PS: searching on 'BootstrapApplicationListener$CloseContextOnFailureApplicationListener' would have lead you there straight away :-)

    0 讨论(0)
  • 2021-01-25 02:58

    Ok - did some testing here. Created empty SpringBoot application from start.spring.io. Imported the project into IntelliJ.

    I then loaded your gradle file contents. Also started by removing all the @ imports in the main (Application) class - just kept @SpringBootApplication. Removed all the other classes (including tests). Had same error. Started by removing all the gradle dependencies for Swagger and Hibernate, etc. Those are not required to get a bare-bones SpringBoot app running. Removing this line solved to error (not throwing the error anymore): compile("org.springframework.security.oauth:spring-security-oauth2")

    So something needs to be configured if you want to do Spring OAuth2 ... for you to find.

    Suggest you add small building blocks at a time - you have a lot of stuff in the SpringBoot main app annotated. Spring will auto-configure defaults for all it can, but you might run into similar problems. Add one annotation - write unit test class that will verify basic functionality of that specific annotation. Then enable the next one, write unit test.... unit all are working with basic test coverage.

    0 讨论(0)
提交回复
热议问题