簡體   English   中英

java.lang.ClassNotFoundException:io.netty.handler.logging.ByteBufFormat

[英]java.lang.ClassNotFoundException: io.netty.handler.logging.ByteBufFormat

我正在將第三方庫集成到我們的應用程序中。 為此,我添加了所有依賴項,但是在應用程序運行時面臨以下錯誤堆棧。

錯誤堆棧跟蹤:`

Caused by: java.lang.ClassNotFoundException: io.netty.handler.logging.ByteBufFormat
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 31 common frames omitted

`

Maven 依賴項:

`

<dependency>
    <groupId>com.affinda.api</groupId>
    <artifactId>affinda-api-client</artifactId>
    <version>0.4.2</version>
</dependency>
<dependency>
    <groupId>com.microsoft.rest</groupId>
    <artifactId>client-runtime</artifactId>
    <version>1.7.14</version>
</dependency>
<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-client-runtime</artifactId>
    <version>1.7.14</version>
</dependency>
<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>azure-client-authentication</artifactId>
    <version>1.7.14</version>
</dependency>
<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-identity</artifactId>
    <version>1.5.0</version>
</dependency>
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-all</artifactId>
    <version>4.1.84.Final</version>
</dependency>
<dependency>
    <groupId>io.netty</groupId>
    <artifactId>netty-handler</artifactId>
    <version>4.1.84.Final</version>
</dependency>

`

我確實從文檔中檢查了 ByteBufFormat 是否在 .netty-handler 庫中,並檢查了依賴關系樹,但沒有任何線索。

可能為時已晚,但我遇到了同樣的問題。 原因是另一個依賴項覆蓋了最終 pom 中的netty版本。 在我的例子中,它是 spring 引導依賴項 (2.2.0-RELEASE),它覆蓋了4.1.42Final版本而不是需要的4.1.86Final版本。 如果你想查誰負責,你可以運行 maven 目標help:effective-pom並搜索 effective.netty 版本管理所有者。 為了解決這個問題,您可以在 maven 屬性中指定 .netty 版本:

<properties>
    .
    .
    <netty.version>4.1.86.Final</netty.version>
</properties>

通過這種方式,您將放回 expected.netty 版本,一切都會像魅力一樣工作。 小心檢查另一個庫是否也在工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM