-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
运行直接报错了,LZ能帮忙看下么。 #6
Comments
按照代码的逻辑,client启动的时候需要加 sync() 阻塞Object.wait,等待异步的 socket 绑定事件完成代码。直接在失败重连那边加上就好 |
是滴,没错,就是LZ注释掉的那行代码 bootstrap.connect(host, port).sync() |
hi,我在加上了这个代码之后任然报错 了 Failed to initialize a channel ,详细信息为 com.pjmike.client.netty.ClientHandler is not a @sharable handler, so can't be added or removed multiple times |
这个问题是因为java版本的问题,当我切换到jdk1.8就没有问题了 |
Exception in thread "main" java.lang.NullPointerException
at com.pjmike.client.netty.ClientHandler.getRpcResponse(ClientHandler.java:53)
at com.pjmike.client.netty.NettyClient.send(NettyClient.java:102)
at com.pjmike.client.proxy.RpcClientDynamicProxy.invoke(RpcClientDynamicProxy.java:54)
at com.sun.proxy.$Proxy37.hello(Unknown Source)
at com.pjmike.client.ClientApplication.main(ClientApplication.java:18)
The text was updated successfully, but these errors were encountered: