Exception in thread "Thread-5" java.lang.NoSuchMethodError: io.netty.util.concurrent.SingleThreadEventExecutor異常處理


異常
Exception in thread "Thread-5" java.lang.NoSuchMethodError: io.netty.util.concurrent.SingleThreadEventExecutor. (Lio/netty/util/concurrent/EventExecutorGroup;Ljava/util/concurrent/Executor;ZLjava/util/Queue;Lio/netty/util/concurrent/RejectedExecutionHandler;)V
at io.netty.channel.SingleThreadEventLoop. (SingleThreadEventLoop.java:65)
at io.netty.channel.nio.NioEventLoop. (NioEventLoop.java:138)
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. (MultithreadEventExecutorGroup.java:84)
at io.netty.util.concurrent.MultithreadEventExecutorGroup. (MultithreadEventExecutorGroup.java:58)
at io.netty.channel.MultithreadEventLoopGroup. (MultithreadEventLoopGroup.java:52)
at io.netty.channel.nio.NioEventLoopGroup. (NioEventLoopGroup.java:96)
at io.netty.channel.nio.NioEventLoopGroup. (NioEventLoopGroup.java:91)
at io.netty.channel.nio.NioEventLoopGroup. (NioEventLoopGroup.java:72)
at io.netty.channel.nio.NioEventLoopGroup. (NioEventLoopGroup.java:52)
at io.netty.channel.nio.NioEventLoopGroup. (NioEventLoopGroup.java:44)
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 啟動沖突

解決方案



org.springframework.boot
spring-boot-starter-data-redis


io.netty
netty-common


io.netty
netty-handler


io.netty
netty-transport


  再次 使用mvn dependency:tree 查看maven 樹
  ![](https://img2020.cnblogs.com/blog/883541/202005/883541-20200519094852830-1835802717.png)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM