异常解决 Caused by: java.lang.NoSuchMethodError: kotlin.collections.ArraysKt.copyInto([B[BIII)[B
问题描述:引入 minio 8.3.5的包后,项目启动失败,异常信息如下
***************************
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:/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:/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
解决流程:
- 使用maven helper搜索pom文件里面的kotlin-stdlib包的依赖层级,发现项目包含两个kotlin-stdlib版本。
- 在低版本的引用包下,排除低版本的依赖,直接引入新版本的包解决
</dependency>
<exclusions>
<exclusion>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>1.3.72</version>
</dependency>