java.lang.NoClassDefFoundError: org/springframework/core/env/ConfigurableEnvironment

后端 未结 7 1502
孤独总比滥情好
孤独总比滥情好 2020-11-27 08:03

I am trying to write a simple RESTful service using Spring Boot. However, there is an error message I am not able to solve. I have been researching and it looks like it is a

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 08:31

    I had same problem with Spring boot 2.1.9.RELEASE

        
            org.springframework.boot
            spring-boot-starter-parent
            2.1.9.RELEASE
             
        
    

    Added pom dependency eliminated this exception:

        
            org.springframework
            spring-core
            5.2.0.RELEASE
        
    

    EDIT - better approach.

    Also clean up of maven repository with spring dependencies resolved problem for me, there were not need to add spring-core 5.2.0.RELEASE in pom. Seems that when I had many versions of spring in repo some problem occurs. Also before again resolve dependencies dont forget clean project.

    rm -rf ~/.m2/repository/org/springframework/
    

提交回复
热议问题