boonproject / boon

Simple opinionated Java for the novice to expert level Java Programmer. Low Ceremony. High Productivity.
http://richardhightower.github.io/site/Boon/Welcome.html
Apache License 2.0
520 stars 102 forks source link

Unable to determine the current character, it is not a string, number, array, or object The current character read is '}' with an int value of 125 #332

Open chandrapersonal opened 9 years ago

chandrapersonal commented 9 years ago

I am getting the below error when using ETCD client to connect to etcd server. After 5 minutes i am getting the error and the connection is disconnected for my service. Below are the error.

The issue is when the channel(connection) between ETCD client and ETCD server is inactive for 5min Etcd client gets notified with responce which has JSON as empty string(" ") not as EMPTY JSON. But the ETCD client looks for EMPTY JSON and throws the exception.

org.boon.json.JsonException: Unable to determine the current character, it is not a string, number, array, or object

The current character read is '}' with an int value of 125 Unable to determine the current character, it is not a string, number, array, or object line number 1 index number 0

^ at org.boon.json.implementation.JsonParserCharArray.complain(JsonParserCharArray.java:193) at org.boon.json.implementation.JsonFastParser.decodeValueOverlay(JsonFastParser.java:174) at org.boon.json.implementation.JsonFastParser.parse(JsonFastParser.java:328) at org.boon.json.implementation.BaseJsonParser.parse(BaseJsonParser.java:127) at org.boon.json.implementation.BaseJsonParserAndMapper.parse(BaseJsonParserAndMapper.java:765) at org.boon.json.implementation.BaseJsonParserAndMapper.parse(BaseJsonParserAndMapper.java:194) at org.boon.json.JsonMappingParser.parse(JsonMappingParser.java:199) at org.boon.etcd.EtcdClient.parseResponse(EtcdClient.java:785) at org.boon.etcd.EtcdClient.access$400(EtcdClient.java:65) at org.boon.etcd.EtcdClient$6$2.handle(EtcdClient.java:744) at org.boon.etcd.EtcdClient$6$2.handle(EtcdClient.java:740) at org.vertx.java.core.http.impl.DefaultHttpClientResponse.handleEnd(DefaultHttpClientResponse.java:203) at org.vertx.java.core.http.impl.ClientConnection.handleResponseEnd(ClientConnection.java:347) at org.vertx.java.core.http.impl.DefaultHttpClient$ClientHandler.doMessageReceived(DefaultHttpClient.java:860) at org.vertx.java.core.http.impl.DefaultHttpClient$ClientHandler.doMessageReceived(DefaultHttpClient.java:830) at org.vertx.java.core.http.impl.VertxHttpHandler.channelRead(VertxHttpHandler.java:72) at org.vertx.java.core.net.impl.VertxHandler.channelRead(VertxHandler.java:155) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:318) at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:148) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:332) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:318) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:125) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:507) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:464) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:378) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at java.lang.Thread.run(Thread.java:745)

Jul 27, 2015 2:29:08 PM org.vertx.java.core.logging.impl.JULLogDelegate error SEVERE: Unhandled exception java.nio.channels.ClosedChannelException at org.vertx.java.core.http.impl.ClientConnection$2.handle(ClientConnection.java:256) at org.vertx.java.core.http.impl.ClientConnection$2.handle(ClientConnection.java:246) at org.vertx.java.core.net.impl.ConnectionBase.handleClosed(ConnectionBase.java:137) at org.vertx.java.core.http.impl.ClientConnection.handleClosed(ClientConnection.java:367) at org.vertx.java.core.net.impl.VertxHandler$3.run(VertxHandler.java:120) at org.vertx.java.core.impl.DefaultContext$3.run(DefaultContext.java:175) at org.vertx.java.core.impl.DefaultContext.execute(DefaultContext.java:135) at org.vertx.java.core.net.impl.VertxHandler.channelInactive(VertxHandler.java:118) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:232) at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:218) at io.netty.handler.codec.ReplayingDecoder.channelInactive(ReplayingDecoder.java:347) at io.netty.handler.codec.http.HttpClientCodec$Decoder.channelInactive(HttpClientCodec.java:212) at io.netty.channel.CombinedChannelDuplexHandler.channelInactive(CombinedChannelDuplexHandler.java:133) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:232) at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:218) at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:769) at io.netty.channel.AbstractChannel$AbstractUnsafe$5.run(AbstractChannel.java:568) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:370) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:353) at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at java.lang.Thread.run(Thread.java:745)