1

我已按照以下链接中的所有说明快速启动 grpc-java 教程:

https://github.com/grpc/grpc-java/tree/master/examples but the command
../gradlew installDist 

构建成功,但是当我运行服务器时,它显示结果如下:

pradnya@pradnya-VirtualBox:~/grpc-java/examples$ ./build/install/grpc-examples/bin/hello-world-server 2015 年 9 月 7 日下午 6:36:21 io.grpc.examples.helloworld.HelloWorldServer启动信息:服务器已启动,正在侦听 50051 * 正在关闭 gRPC 服务器,因为 JVM 正在关闭 *服务器已关闭

4

1 回答 1

2

最近的一个变化(从 9 月 2 日星期四开始)打破了这个例子。解决方法是server.awaitTermination()在方法末尾添加一个start(),这将阻止 JVM 退出。您还需要将start()和标记main()throws InterruptedException。我做了一个 GitHub 问题来跟踪更新示例。

于 2015-09-08T03:28:56.983 回答