六月 19, 2018 1:49:25 下午 io.netty.channel.ChannelInitializer channelRegistered
警告: Failed to initialize a channel. Closing: [id: 0x1bd7c1d4, /0:0:0:0:0:0:0:1:56640 => /0:0:0:0:0:0:0:1:8888]
java.lang.IllegalArgumentException: Duplicate handler name: aggregator
at io.netty.channel.DefaultChannelPipeline.checkDuplicateName(DefaultChannelPipeline.java:949)
at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:141)
at io.netty.channel.DefaultChannelPipeline.addLast(DefaultChannelPipeline.java:130)
at xzx.MyWebSocketChannelHandler.initChannel(MyWebSocketChannelHandler.java:14)
at xzx.MyWebSocketChannelHandler.initChannel(MyWebSocketChannelHandler.java:10)
at io.netty.channel.ChannelInitializer.channelRegistered(ChannelInitializer.java:69)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelRegisteredNow(ChannelHandlerInvokerUtil.java:30)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRegistered(DefaultChannelHandlerInvoker.java:49)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRegistered(DefaultChannelHandlerContext.java:285)
at io.netty.channel.ChannelInitializer.channelRegistered(ChannelInitializer.java:71)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelRegisteredNow(ChannelHandlerInvokerUtil.java:30)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRegistered(DefaultChannelHandlerInvoker.java:49)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRegistered(DefaultChannelHandlerContext.java:285)
at io.netty.channel.DefaultChannelPipeline.fireChannelRegistered(DefaultChannelPipeline.java:801)
at io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:427)
at io.netty.channel.AbstractChannel$AbstractUnsafe.access$100(AbstractChannel.java:369)
at io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:403)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:318)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:794)
at java.lang.Thread.run(Thread.java:745)
pipeline.addLast("handler", new MyWebSocketHandler()); 之前写成pipeline.addLast("handler", new MyWebSocketChannelHandler()); 了,结果报的重复的问题。改了就好了
我也是这个问题,换了
5.0.0.Alpha2
就报这个错误,不知道该怎么解决
你好,请问找到原因了吗?
aggregator 这个 handler 你加了2次吧