mrniko / netty-socketio

Socket.IO server implemented on Java. Realtime java framework
Apache License 2.0
6.82k stars 1.65k forks source link

Nullpointer exception when use safari browser #273

Open fcbflying opened 9 years ago

fcbflying commented 9 years ago

Normally, it works fine. But if I click the send message button crazily in high frequency with safari brwoser. The NullPointerException will be thrown out from the method valueOfInner of class PacketType. But it works fine with other browsers ( firefox, chrome, ie). Any idea for this ? Thanks advanced.

mrniko commented 9 years ago

what about other browsers?

fcbflying commented 9 years ago

Other browsers works fine.Only for safari, this will happen.

mrniko commented 9 years ago

could you please switch debug level of "com.corundumstudio" to trace and publish this log?

fcbflying commented 9 years ago

The exception is difference some times when I click the send message button crazily in high frequency with safari brwoser.

Here is the exception:

[nioEventLoopGroup-3-5] ERROR com.corundumstudio.socketio.handler.InPacketHandler - Error during data processing. Client sessionId: 929e7685-0a0e-4117-aaa8-bfbe1f8204e1, data: "hello world!"}] java.lang.IllegalStateException at com.corundumstudio.socketio.protocol.PacketType.valueOf(PacketType.java:48) at com.corundumstudio.socketio.protocol.PacketDecoder.readType(PacketDecoder.java:95) at com.corundumstudio.socketio.protocol.PacketDecoder.decode(PacketDecoder.java:168) at com.corundumstudio.socketio.protocol.PacketDecoder.decodePackets(PacketDecoder.java:150) at com.corundumstudio.socketio.handler.InPacketHandler.channelRead0(InPacketHandler.java:65) at com.corundumstudio.socketio.handler.InPacketHandler.channelRead0(InPacketHandler.java:36) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:187) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) at com.corundumstudio.socketio.transport.WebSocketTransport.channelRead(WebSocketTransport.java:94) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at com.corundumstudio.socketio.transport.PollingTransport.channelRead(PollingTransport.java:109) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at com.corundumstudio.socketio.handler.AuthorizeHandler.channelRead(AuthorizeHandler.java:115) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:182) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:308) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:294) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:846) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:130) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) at java.lang.Thread.run(Thread.java:745)

sameershenai commented 8 years ago

I am getting the same exception on chrome (Using version 1.7.5

I see that the following network calls from browser. First three are successful

1) ?EIO=3&transport=polling&t=1463785725672-0 2) ?EIO=3&transport=polling&t=1463785725993-1&sid=a5e49fc7-6cb4-4bb9-9356-dd80b0198889 3)?EIO=3&transport=polling&t=1463785726260-2&sid=a5e49fc7-6cb4-4bb9-9356-dd80b0198889 Request Method:POST

4)EIO=3&transport=polling&t=1463785726262-3&sid=a5e49fc7-6cb4-4bb9-9356-dd80b0198889

Last call gives 500 Internal server error