Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-11-23 16:33:13.246 ERROR 24268 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter -
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
okio.Segment.writeTo(Segment.kt:169)
The following method did not exist:
kotlin.collections.ArraysKt.copyInto([B[BIII)[B
The method's class, kotlin.collections.ArraysKt, is available from the following locations:
jar:file:/S:/Developers/Configuration/Maven/repository/org/jetbrains/kotlin/kotlin-stdlib/1.2.71/kotlin-stdlib-1.2.71.jar!/kotlin/collections/ArraysKt.class
It was loaded from the following location:
file:/S:/Developers/Configuration/Maven/repository/org/jetbrains/kotlin/kotlin-stdlib/1.2.71/kotlin-stdlib-1.2.71.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of kotlin.collections.ArraysKt
Disconnected from the target VM, address: '127.0.0.1:8553', transport: 'socket'
Process finished with exit code 1
错误信息
- 注意看这里,有可能是别的包版本依赖有问题。
- 我这里是springboot集成Nacos的时候遇到的问题。
解决方案
- 在pom文件中添加下面依赖,就完美解决,因为项目中之前没有引入过下面依赖。
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.3.70</version>
</dependency>