Skip to content

Instantly share code, notes, and snippets.

12:36:12,656 WARN nioEventLoopGroup-32-9 channel.DefaultChannelPipeline:57 - An exception was thrown by a user handler's exceptionCaught() method while handling the following exception:
io.netty.handler.codec.DecoderException: java.lang.NullPointerException
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:320)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
at io.netty.channel.DefaultChannelHandlerConte
@cloudbow
cloudbow / gist:9188444
Created February 24, 2014 13:29
NPE in HttpObjectAggregator
io.netty.handler.codec.DecoderException: java.lang.NullPointerException
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:332)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeChannelReadNow(ChannelHandlerInvokerUtil.java:74)
at io.netty.channel.DefaultChannelHandlerInvoker.invokeChannelRead(DefaultChannelHandlerInvoker.java:138)
at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:332)
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:156)
@cloudbow
cloudbow / gist:9189698
Created February 24, 2014 14:50
NPE in HOA
20:18:17,949 DEBUG nioEventLoopGroup-32-4 channel.DefaultChannelPipeline:1008 - Discarded inbound message DefaultHttpResponse(decodeResult: success)
HTTP/1.1 200 OK
epoch: 1393253232673
Content-Language: *
Date: Mon, 24 Feb 2014 14:47:12 GMT
Accept-Ranges: bytes
Server: Noelios-Restlet-Engine/1.1.3
Content-Type: application/json;charset=UTF-8
Content-Length: 5818
Vary: Accept-Encoding
@cloudbow
cloudbow / gist:9327263
Created March 3, 2014 15:24
netty connection pool
@Component
public class ApnsChannelsPerAppCollection extends HashMap<String, BlockingQueue<Channel>> {
/** The logger. */
private final Logger logger = Logger.getLogger(ApnsChannelsPerAppCollection.class);
/** The Constant serialVersionUID. */
private static final long serialVersionUID = 1L;
/** The atomic batch counter. */
@cloudbow
cloudbow / gist:9501934
Created March 12, 2014 06:33
java.lang.OutOfMemoryError: Direct buffer memory
00:05:35,089 WARN GcmChannelsPerAppEVG-1-4 channel.DefaultChannelPipeline:181 - Failed to fail the promise because it's done already: DefaultChannelPromise@3dd47dcb(failure(io.netty.handler.codec.EncoderException: java.lang.OutOfMemoryError: Direct buffer memory)
io.netty.handler.codec.EncoderException: java.lang.OutOfMemoryError: Direct buffer memory
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:107)
at io.netty.channel.ChannelHandlerInvokerUtil.invokeWriteNow(ChannelHandlerInvokerUtil.java:140)
at io.netty.channel.DefaultChannelHandlerInvoker$WriteTask.run(DefaultChannelHandlerInvoker.java:425)
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:799)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.OutOfMemoryError: Direct buffer memory
@cloudbow
cloudbow / gist:9513080
Created March 12, 2014 18:21
monotonous loop
package gcm.netty.codec;
import gcm.netty.config.GcmConfig;
import gcm.netty.constants.ErrorConstants;
import gcm.netty.model.BatchFullGcmMessage;
import gcm.netty.syslog.GcmSysLogger;
import gcm.netty.syslog.Statistics;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
@cloudbow
cloudbow / gist:9513137
Created March 12, 2014 18:24
with monotonous loop outside
package gcm.netty.codec;
import gcm.netty.config.GcmConfig;
import gcm.netty.syslog.GcmSysLogger;
import gcm.netty.syslog.Statistics;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.MessageToMessageEncoder;
import io.netty.handler.codec.http.DefaultFullHttpRequest;
@cloudbow
cloudbow / gist:9513287
Created March 12, 2014 18:30
after memory out
12:28:01,703 ERROR GcmChannelsPerAppEVG-1-23 util.ResourceLeakDetector:217 - LEAK: ByteBuf.release() was not called before it's garbage-collected.
Recent access records: 2
#2:
Hint: 'ssl' will handle the message from this point.
io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:331)
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846)
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:117)
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:494)
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:461)
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378)
@cloudbow
cloudbow / gist:9513470
Created March 12, 2014 18:38
inbound handler
package gcm.netty.handlers;
import gcm.netty.constants.ApplicationContextComponents;
import gcm.netty.constants.TraceLogs;
import gcm.netty.queues.batch.BatchGcmMessageQueue;
import gcm.netty.syslog.Statistics;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.FullHttpResponse;
@cloudbow
cloudbow / gist:9513536
Created March 12, 2014 18:40
initializer
package gcm.netty.handlers;
import gcm.netty.codec.GcmBatchMessageEncoder;
import gcm.netty.config.GcmConfig;
import gcm.netty.constants.GcmProtocolConstants;
import gcm.netty.constants.TraceLogs;
import gcm.netty.security.GcmSSLContextFactory;
import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;