java.lang.NoClassDefFoundError: Не удалось инициализировать класс com.twitter.finagle.Init $ - PullRequest
0 голосов
/ 16 мая 2018

У меня есть проект с зависимостью от finagle 7.1.0 и связанных библиотек с версией Scala как 2.11.11

Когда я обновил версию scala до 2.12.6 и версию finagle как 17.12.0, я получаю ошибку ниже.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.twitter.finagle.Init$
    at com.twitter.finagle.client.StackClient$.endpointStack(StackClient.scala:54)
    at com.twitter.finagle.client.StackClient$.newStack(StackClient.scala:220)
    at com.twitter.finagle.builder.ClientConfig$NilClient$.apply$default$1(ClientBuilder.scala:74)
    at com.twitter.finagle.builder.ClientConfig$.nilClient(ClientBuilder.scala:91)
    at com.twitter.finagle.builder.ClientBuilder.<init>(ClientBuilder.scala:248)
    at com.twitter.finagle.builder.ClientBuilder$.apply(ClientBuilder.scala:46)
    at com.twitter.finagle.builder.ClientBuilder$.get(ClientBuilder.scala:52)
    at com.twitter.finagle.builder.ClientBuilder.get(ClientBuilder.scala)

Ниже приведен график зависимости для jar, связанных с finagle -

[INFO] +- com.twitter:finagle-core_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:finagle-toggle_2.12:jar:17.12.0:compile
[INFO] |  |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.8.8:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-annotations:jar:2.8.8:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-scala_2.12:jar:2.8.8:compile
[INFO] |  |     \- com.fasterxml.jackson.module:jackson-module-paranamer:jar:2.8.8:compile
[INFO] |  +- com.twitter:finagle-init_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-app_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-cache_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-codec_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-core_2.12:jar:17.12.0:compile
[INFO] |  |  +- com.twitter:util-function_2.12:jar:17.12.0:compile
[INFO] |  |  +- org.scala-lang:scala-reflect:jar:2.12.6:compile
[INFO] |  |  \- org.scala-lang.modules:scala-parser-combinators_2.12:jar:1.0.4:compile
[INFO] |  +- com.twitter:util-hashing_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-jvm_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-lint_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-logging_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-registry_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-security_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-stats_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:util-tunable_2.12:jar:17.12.0:compile
[INFO] |  +- com.github.ben-manes.caffeine:caffeine:jar:2.3.4:compile
[INFO] |  \- com.google.code.findbugs:jsr305:jar:2.0.1:compile
[INFO] +- org.scala-lang.modules:scala-java8-compat_2.12:jar:0.9.0:compile
[INFO] +- com.twitter:finagle-http_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:finagle-base-http_2.12:jar:17.12.0:compile
[INFO] |  |  \- com.twitter:finagle-netty3_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:finagle-netty3-http_2.12:jar:17.12.0:compile
[INFO] |  +- com.twitter:finagle-netty4-http_2.12:jar:17.12.0:compile
[INFO] |  |  +- com.twitter:finagle-netty4_2.12:jar:17.12.0:compile
[INFO] |  |  \- io.netty:netty-codec-http:jar:4.1.16.Final:compile
[INFO] |  |     \- io.netty:netty-codec:jar:4.1.16.Final:compile
[INFO] |  +- com.twitter:finagle-http2_2.12:jar:17.12.0:compile
[INFO] |  |  +- io.netty:netty-codec-http2:jar:4.1.16.Final:compile
[INFO] |  |  +- io.netty:netty-handler:jar:4.1.16.Final:compile
[INFO] |  |  |  \- io.netty:netty-buffer:jar:4.1.16.Final:compile
[INFO] |  |  +- io.netty:netty-transport:jar:4.1.16.Final:compile
[INFO] |  |  |  \- io.netty:netty-resolver:jar:4.1.16.Final:compile
[INFO] |  |  +- io.netty:netty-transport-native-epoll:jar:linux-x86_64:4.1.16.Final:compile
[INFO] |  |  |  \- io.netty:netty-common:jar:4.1.16.Final:compile
[INFO] |  |  +- io.netty:netty-transport-native-unix-common:jar:4.1.16.Final:compile
[INFO] |  |  \- io.netty:netty-handler-proxy:jar:4.1.16.Final:compile
[INFO] |  |     \- io.netty:netty-codec-socks:jar:4.1.16.Final:compile
[INFO] |  \- com.twitter:util-collection_2.12:jar:17.12.0:compile

Я вижу похожую проблему при обновлении версии finagle здесь , но в моем случае зависимости util действительны.

Есть идеи, как решить эту проблему?

...