mrniko / netty-socketio

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

NPE while connecting to netty-socketio 1.7.3 from Java Socketio Client using socket.io-1.x #179

Closed SharathChandraB closed 10 years ago

SharathChandraB commented 10 years ago

Hi,

I am using Gottox/socket.io-java-client to connect to netty-socketio server (v1.7.3), but it is throwing a NPE as shown below. I am using the socket.io version 1.x for the connection and the URL which is sent from the client is http://localhost:9332/socket.io/1/?EIO=2&transport=polling as you can see below, an extract from log file.

Can you please let me know in case we need to send some extra parameter from the client to get it working?

10:13:14.170 [ConnectThread] INFO io.socket - URL: http://localhost:9332/socket.io/1/?EIO=2&transport=polling 10:13:14.201 [nioEventLoopGroup-3-1] WARN i.n.channel.DefaultChannelPipeline - 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: null at com.corundumstudio.socketio.transport.PollingTransport.channelRead(PollingTransport.java:101) ~[na:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [4.0.23.Final:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [4.0.23.Final:4.0.23.Final] at com.corundumstudio.socketio.handler.AuthorizeHandler.channelRead(AuthorizeHandler.java:115) [1.7.3:na] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [4.0.23.Final:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [4.0.23.Final:4.0.23.Final] at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:108) [4.0.23.Final:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [4.0.23.Final:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) [4.0.23.Final:4.0.23.Final] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) [4.0.23.Final:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) [4.0.23.Final:4.0.23.Final]

mrniko commented 10 years ago

Gottox/socket.io-java-client is not compatible with 1.0 protocol. Use netty-socketio 1.6.6

SharathChandraB commented 10 years ago

There is a commit on java-client which supports the socket.io 1.0 and I have tested it with node socket io server 1.0 and it works well. The issue is with connecting to this server, if you can just let me know in case we need to pass any extra parameter that would be great.

mrniko commented 10 years ago

Could you watch in debug has you passed the AuthorizeHandler.authorize method?