java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener: org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor
java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:441) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:420) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:411) at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:268) at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:247) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234) at com.bingqi.App.main(App.java:19) Caused by: java.lang.IllegalArgumentException: class org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor is not assignable to interface org.springframework.context.ApplicationListener at org.springframework.util.Assert.assignableCheckFailed(Assert.java:655) at org.springframework.util.Assert.isAssignable(Assert.java:586) at org.springframework.util.Assert.isAssignable(Assert.java:617) at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:434) ... 7 more
idea应该是没有自动清理到缓存,导致有多个版本的spring-boot在启动时都被加载了,故找不到合适的CloudFoundryVcapEnvironmentPostProcessor来实例化,然后就报错了,搜索,然后删除多余版本的spring-boot jar包
参考:
https://blog.csdn.net/cin_ie/article/details/107021916
https://blog.csdn.net/weixin_42547668/article/details/105728747?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522164467335516780269817708%2522%252C%2522scm%2522%253A%252220140713.130102334.pc%255Fall.%2522%257D&request_id=164467335516780269817708&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2allfirst_rank_ecpm_v1~rank_v31_ecpm-1-105728747.pc_search_result_positive&utm_term=class+org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor+is+not+assignable+to+interface+org.springframework.context.ApplicationListener&spm=1018.2226.3001.4187