Skip to content

java.lang.String cannot be converted to okhttp3.MediaType #7920

@funky-eyes

Description

@funky-eyes

Check Ahead

  • I have searched the issues of this repository and believe that this is not a duplicate.

  • I am willing to try to fix this bug myself.

Ⅰ. Issue Description

https://github.com/apache/incubator-seata/actions/runs/20753876763/job/59590388727

Error:  Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project seata-common: Compilation failure: Compilation failure: 
Error:  /Users/runner/work/incubator-seata/incubator-seata/common/src/main/java/org/apache/seata/common/util/HttpClientUtil.java:[108,30] no suitable method found for create(java.lang.String,okhttp3.MediaType)
Error:      method okhttp3.RequestBody.create(okhttp3.MediaType,java.lang.String) is not applicable
Error:        (argument mismatch; java.lang.String cannot be converted to okhttp3.MediaType)
Error:      method okhttp3.RequestBody.create(okhttp3.MediaType,okio.ByteString) is not applicable
Error:        (argument mismatch; java.lang.String cannot be converted to okhttp3.MediaType)
Error:      method okhttp3.RequestBody.create(okhttp3.MediaType,byte[]) is not applicable
Error:        (argument mismatch; java.lang.String cannot be converted to okhttp3.MediaType)
Error:      method okhttp3.RequestBody.create(okhttp3.MediaType,java.io.File) is not applicable
Error:        (argument mismatch; java.lang.String cannot be converted to okhttp3.MediaType)

I suspect that different versions of Spring Boot depend on different versions of OkHttp, which could cause compatibility issues. To avoid conflicts arising from changes in Spring Boot versions, we should manually specify a fixed, reliable version of OkHttp 3.

Ⅱ. Describe what happened

No response

Ⅲ. Describe what you expected to happen

No response

Ⅳ. How to reproduce it (as minimally and precisely as possible)

No response

Ⅴ. Anything else we need to know?

No response

Ⅵ. Environment

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions