maydemirx / moquette-mqtt

Automatically exported from code.google.com/p/moquette-mqtt
Apache License 2.0
0 stars 1 forks source link

Websocket java.lang.NullPointerException using Paho mqttws31.js with Moquette .6 #53

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using 0.6 versión with index.html you provided, and using mqttws31.js 
downloaded from http://www.eclipse.org/paho/clients/js/, and when trying to hit 
connect button, i get next error message on server:

18:35:27,746 DEBUG io.netty.util.ResourceLeakDetector:76 - 
-Dio.netty.noResourceLeakDetection: false
18:35:27,783 DEBUG 
io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker:71 - [id: 
0xc41b4658, /127.0.0.1:2410 => /127.0.0.1:8080] WS Version V13 server handshake
18:35:27,786 DEBUG 
io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker:71 - WS 
Version 13 Server Handshake key: 2WP6OSP2ldJdlDY5NPZxBw==. Response: 
pzANkZagf3dP0kQ33Jq8676lnQI=.
18:35:27,789  WARN io.netty.channel.DefaultChannelPipeline:151 - An 
exceptionCaught() event was fired, and it reached at the tail of the pipeline. 
It usually means the last handler in the pipeline did not handle the exception.
java.lang.NullPointerException
    at org.dna.mqtt.moquette.server.netty.NettyMQTTHandler.channelInactive(NettyMQTTHandler.java:81)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:232)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:218)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:232)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:218)
    at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:214)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:232)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:218)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:232)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:218)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:232)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:218)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:232)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:218)
    at io.netty.channel.ChannelInboundHandlerAdapter.channelInactive(ChannelInboundHandlerAdapter.java:75)
    at io.netty.handler.codec.http.HttpObjectAggregator.channelInactive(HttpObjectAggregator.java:219)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:232)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:218)
    at io.netty.handler.codec.ReplayingDecoder.channelInactive(ReplayingDecoder.java:347)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelInactive(DefaultChannelHandlerContext.java:232)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelInactive(DefaultChannelHandlerContext.java:218)
    at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:767)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:558)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:354)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:348)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    at java.lang.Thread.run(Thread.java:662)
18:35:28,098 DEBUG 
io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker:71 - [id: 
0x03e036d5, /127.0.0.1:2412 => /127.0.0.1:8080] WS Version V13 server handshake
18:35:28,099 DEBUG 
io.netty.handler.codec.http.websocketx.WebSocketServerHandshaker:71 - WS 
Version 13 Server Handshake key: SCvw+oSgc9B2l6x3dMc0SA==. Response: 
lF1UZN3/15mn05D1WxND16bjzsw=.
18:35:28,105 DEBUG 
io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder:76 - Decoding 
WebSocket Frame opCode=2
18:35:28,106 DEBUG 
io.netty.handler.codec.http.websocketx.WebSocket08FrameDecoder:76 - Decoding 
WebSocket Frame length=24
18:35:28,108  WARN io.netty.channel.DefaultChannelPipeline:151 - An 
exceptionCaught() event was fired, and it reached at the tail of the pipeline. 
It usually means the last handler in the pipeline did not handle the exception.
io.netty.handler.codec.DecoderException: 
io.netty.util.IllegalReferenceCountException: refCnt: 0
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:263)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:131)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:332)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:318)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:332)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:318)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:332)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:318)
    at io.netty.handler.codec.http.websocketx.WebSocketServerProtocolHandler$1.channelRead(WebSocketServerProtocolHandler.java:133)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:332)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:318)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:173)
    at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:332)
    at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:318)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:100)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:478)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:447)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:341)
    at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
    at java.lang.Thread.run(Thread.java:662)
Caused by: io.netty.util.IllegalReferenceCountException: refCnt: 0
    at io.netty.buffer.AbstractByteBuf.ensureAccessible(AbstractByteBuf.java:1171)
    at io.netty.buffer.AbstractByteBuf.checkIndex(AbstractByteBuf.java:1117)
    at io.netty.buffer.AbstractByteBuf.getByte(AbstractByteBuf.java:330)
    at io.netty.buffer.AbstractByteBuf.readByte(AbstractByteBuf.java:563)
    at org.dna.mqtt.moquette.parser.netty.Utils.decodeRemainingLenght(Utils.java:75)
    at org.dna.mqtt.moquette.parser.netty.Utils.checkHeaderAvailability(Utils.java:47)
    at org.dna.mqtt.moquette.parser.netty.MQTTDecoder.decode(MQTTDecoder.java:55)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:232)
    ... 22 more

Original issue reported on code.google.com by bppa...@gmail.com on 27 Nov 2014 at 2:16

GoogleCodeExporter commented 8 years ago
https://github.com/andsel/moquette/issues/5

Original comment by selva.an...@gmail.com on 6 Dec 2014 at 3:48