springboot 1.5.10 +kotlin 1.2.20 解决 java.lang.ClassNotFoundException: kotlin.reflect.KotlinReflectionInternalError

使用http://start.spring.io/ 下载的 项目 跑单元测试 报 java.lang.ClassNotFoundException: kotlin.reflect.KotlinReflectionInternalError

原因是

默认情况下 jackson-module-kotlin版本 引用的 kotlin-reflect 太低
新的 kotlin-reflect 中已经 没有 KotlinReflectionInternalError 这类

解决方法

 声明 jackson-module-kotlin 的具体版本 例如 

<dependency>
    <groupId>com.fasterxml.jackson.module</groupId>
        <artifactId>jackson-module-kotlin</artifactId>
    <version>2.9.4.1</version>
</dependency>

 

posted @ 2018-02-23 16:39  沐松  阅读(2797)  评论(1编辑  收藏  举报