java.lang.NoSuchMethodError: io.netty.util.NetUtil.toSocketAddressString(Ljava/lang/String;I)Ljava/l
原因:原来应用中某个依赖中包含了netty的新版本,后来引入的另一个依赖中包含netty的旧版本,两者之间产生了冲突,导致某个地方的类使用的是老的版本,所以找不到类的某个方法了!
IntelliJ IDEA也不会自动提示该冲突!
解决办法:排除该冲突中的netty依赖
java.lang.NoSuchMethodError: io.netty.util.NetUtil.toSocketAddressString(Ljava/lang/String;I)Ljava/lang/String;
at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker.websocketHostValue(WebSocketClientHandshaker.java:467)
at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker13.newHandshakeRequest(WebSocketClientHandshaker13.java:118)
at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker.handshake(WebSocketClientHandshaker.java:163)
at io.netty.handler.codec.http.websocketx.WebSocketClientHandshaker.handshake(WebSocketClientHandshaker.java:151)
at org.apache.tinkerpop.gremlin.driver.handler.WebSocketClientHandler.channelActive(WebSocketClientHandler.java:61)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:168)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:154)
at io.netty.channel.ChannelInboundHandlerAdapter.channelActive(ChannelInboundHandlerAdapter.java:64)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:168)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:154)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelActive(CombinedChannelDuplexHandler.java:404)
at io.netty.channel.ChannelInboundHandlerAdapter.channelActive(ChannelInboundHandlerAdapter.java:64)
at io.netty.channel.CombinedChannelDuplexHandler.channelActive(CombinedChannelDuplexHandler.java:203)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelActive(AbstractChannelHandlerContext.java:168)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelActive(AbstractChannelHandlerContext.java:154)
at io.netty.channel.DefaultChannelPipeline.fireChannelActive(DefaultChannelPipeline.java:933)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.fulfillConnectPromise(AbstractNioChannel.java:260)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.finishConnect(AbstractNioChannel.java:290)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:545)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:485)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:399)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:371)
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:112)
at java.lang.Thread.run(Thread.java:748)