我在spring-boot项目中遇到一个特定依赖项的问题。我正在使用netty-tcnative-boringssl-static,并将spring-boot版本从2.0.5升级到2.1.3,现在收到以下无法解密的错误消息:

***************************
APPLICATION FAILED TO START
***************************

Description:
An attempt was made to call the method io.netty.internal.tcnative.SSLContext.setCipherSuite(JLjava/lang/String;Z)Z but it does not exist. Its class, io.netty.internal.tcnative.SSLContext, is available from the following locations:

    jar:file:/C:/Users/xxx/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.12.Final/netty-tcnative-boringssl-static-2.0.12.Final.jar!/io/netty/internal/tcnative/SSLContext.class

It was loaded from the following location:

    file:/C:/Users/xxx/.m2/repository/io/netty/netty-tcnative-boringssl-static/2.0.12.Final/netty-tcnative-boringssl-static-2.0.12.Final.jar


Action:
Correct the classpath of your application so that it contains a single, compatible version of io.netty.internal.tcnative.SSLContext

我不完全理解此错误消息,声明的路径是相同的,在我的类路径上,我可以使用请求的方法找到该库。

我认为可能由于某种原因netty-tcnative-boringssl-static与spring-boot> 2.1.0不兼容。错误消息中的方法签名使我感到困惑。

setCipherSuite(JLjava/lang/String;Z)Zpublic static boolean setCipherSuite(long ctx, String ciphers)

我不确定这是否是实际的不匹配,如果不是,那么我就没主意了,如果是,那么我可以通过摆弄不同的版本来解决它。

有人知道吗?