报错截图:报错内容
***************************
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:
io.minio.S3Base.<clinit>(S3Base.java:104)
The following method did not exist:
'okhttp3.RequestBody okhttp3.RequestBody.create(byte[], okhttp3.MediaType)'
The method's class, okhttp3.RequestBody, is available from the following locations:
jar:file:/Users/liuzhenda/.m2/repository/com/squareup/okhttp3/okhttp/3.14.9/okhttp-3.14.9.jar!/okhttp3/RequestBody.class
The class hierarchy was loaded from the following locations:
okhttp3.RequestBody: file:/Users/liuzhenda/.m2/repository/com/squareup/okhttp3/okhttp/3.14.9/okhttp-3.14.9.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of okhttp3.RequestBody
贼恶心 ,明明在 pom 中已经指定了 okhttp 的版本 运行起来还是 3.14.9
使用 mvn dependency:tree 查看 jar 包的引用也只有 minio 使用了
实际上 springBoot 也使用了 在父工程中点击进去
就会发现原来是这小子在这捣乱 他 mmmm 的 大 sa 鼻
在父 pom 中添加 okhttp 4.8.1 的依赖 覆盖 3.14.9
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
<druid.version>1.2.20</druid.version>
<bitwalker.version>1.21</bitwalker.version>
<swagger.version>3.0.0</swagger.version>
<kaptcha.version>2.3.3</kaptcha.version>
<pagehelper.boot.version>1.4.7</pagehelper.boot.version>
<fastjson.version>2.0.43</fastjson.version>
<oshi.version>6.4.13</oshi.version>
<commons.io.version>2.13.0</commons.io.version>
<poi.version>4.1.2</poi.version>
<velocity.version>2.3</velocity.version>
<jwt.version>0.9.1</jwt.version>
<okhttp3.version>4.8.1</okhttp3.version>
</properties>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp3.version}</version>
</dependency>