私がコンパイルしようとして実行されるJava grpcクライアントのみローカルの依存関係を使用して、私は次のエラーを取得していています:Javaのgrpcランタイムエラー
apply plugin: 'java'
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile name: 'grpc-netty-1.0.3'
compile name: 'grpc-okhttp-1.0.3'
compile name: 'grpc-protobuf-1.0.3'
compile name: 'grpc-stub-1.0.3'
compile name: 'grpc-core-1.0.3'
compile name: 'guava-20.0'
compile name: 'protobuf-java-3.1.0'
}
jar {
manifest {
attributes(
'Main-Class': 'myclient.myClient',
'Class-Path': configurations.compile.collect {it.getName() }.join(' ')
)
}
}
:ここ
Exception in thread "main" java.lang.NoClassDefFoundError: io/netty/channel/socket/nio/NioSocketChannel
at io.grpc.netty.NettyChannelBuilder.<init>(NettyChannelBuilder.java:69)
at io.grpc.netty.NettyChannelBuilder.<init>(NettyChannelBuilder.java:103)
at io.grpc.netty.NettyChannelBuilder.forAddress(NettyChannelBuilder.java:91)
at io.grpc.netty.NettyChannelProvider.builderForAddress(NettyChannelProvider.java:52)
at io.grpc.netty.NettyChannelProvider.builderForAddress(NettyChannelProvider.java:38)
at io.grpc.ManagedChannelBuilder.forAddress(ManagedChannelBuilder.java:45)
at myclient.MyClient.<init>(myClient.java:28)
at myclient.MyClient.main(myClient.java:90)
Caused by: java.lang.ClassNotFoundException: io.netty.channel.socket.nio.NioSocketChannel
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 8 more
は私のGradleファイルです
プログラムはコンパイルされますが、実行されません。私はすでにprotosから私のJavaファイルを生成し、私が使用しているjarライブラリに対応する正しいprotocとprotoc-gen-grpc-javaを使用していることを確認しました。どんな助けもありがとうございます。
てくれてありがとうを確認してください。私はjarファイルを追加し、このエラーが発生しました:http://pastebin.com/tyPKJvPT – CoderCole
@CoderCole、pastebinへのアクセスがありません。 – hanumant
すべての依存関係を追加しようとしましたが、今はio/grpc/Contextに関する別のNoClassDefFoundError $ CancellationListener – CoderCole