SpringBoot项目启动报错问题排查

SpringBoot项目启动报错问题排查

错误日志:

Exception in thread “main” java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : org.springframework.boot.autoconfigure.SharedMetadataReaderFactoryContextInitializer
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:439)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:421)
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:414)
at org.springframework.boot.SpringApplication.(SpringApplication.java:269)
at org.springframework.boot.SpringApplication.(SpringApplication.java:250)
at cn.udesk.imc.server.Application.main(Application.java:15)
Caused by: java.lang.NoSuchMethodError: org.springframework.core.KotlinDetector.isKotlinReflectPresent()Z
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:171)
at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:435)
… 5 more
Disconnected from the target VM, address: ‘127.0.0.1:55866’, transport: ‘socket’

Process finished with exit code 1

原因:项目中引入了如下依赖

org.springframework spring-core 5.0.4.RELEASE

解决:去除以上依赖即可

总结:具体原因没有找到, 有时间还是得继续找


版权声明:本文为lylzdd原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。