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>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM