异常
Exception in thread "Thread-5" java.lang.NoSuchMethodError: io.netty.util.concurrent.SingleThreadEventExecutor.
at io.netty.channel.SingleThreadEventLoop.
at io.netty.channel.nio.NioEventLoop.
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:146)
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:37)
at io.netty.util.concurrent.MultithreadEventExecutorGroup.
at io.netty.util.concurrent.MultithreadEventExecutorGroup.
at io.netty.channel.MultithreadEventLoopGroup.
at io.netty.channel.nio.NioEventLoopGroup.
at io.netty.channel.nio.NioEventLoopGroup.
at io.netty.channel.nio.NioEventLoopGroup.
at io.netty.channel.nio.NioEventLoopGroup.
at io.netty.channel.nio.NioEventLoopGroup.
at com.diesheng.wehat.websocket.NettyServer.startServer(NettyServer.java:39)
at com.diesheng.wehat.websocket.NettyServer.access$000(NettyServer.java:22)
at com.diesheng.wehat.websocket.NettyServer$2.run(NettyServer.java:77)
at java.lang.Thread.run(Thread.java:748)
由于单独引用netty版本 在tomcat启动时 出现以上的异常信息 经过搜索 了解问题如下
由于io.lettuce:lettuce-core:jar:5.1.7.RELEASE中引用了其他版本的netty 导致了netty 启动冲突
解决方案
再次 使用mvn dependency:tree 查看maven 树
![](https://www.icode9.com/i/l/?n=20&i=blog/883541/202005/883541-20200519094852830-1835802717.png)