Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upReturn null for JsonObject.mapFrom(null) #370
Comments
|
is it specific to event bus or in general ?
… On 15 May 2018, at 14:04, Matt Nuss ***@***.***> wrote:
Snippet:
// from EventBus handler: Message message
Object r = null;
message.reply(JsonObject.mapFrom(r));
This results in the following exception on the receiving service:
18-May-15 08:02:28:086 ERROR vert.x-eventloop-thread-1 i.v.c.i.ContextImpl:162 - Unhandled exception
io.vertx.core.json.DecodeException: Failed to decode:null
at io.vertx.core.json.Json.decodeValue(Json.java:167)
at io.vertx.core.json.JsonObject.fromBuffer(JsonObject.java:952)
at io.vertx.core.json.JsonObject.(JsonObject.java:72)
at io.vertx.core.eventbus.impl.codecs.JsonObjectMessageCodec.decodeFromWire(JsonObjectMessageCodec.java:34)
at io.vertx.core.eventbus.impl.codecs.JsonObjectMessageCodec.decodeFromWire(JsonObjectMessageCodec.java:21)
at io.vertx.core.eventbus.impl.clustered.ClusteredMessage.decodeBody(ClusteredMessage.java:181)
at io.vertx.core.eventbus.impl.clustered.ClusteredMessage.body(ClusteredMessage.java:88)
at io.vertx.core.eventbus.impl.EventBusImpl.lambda$convertHandler$1(EventBusImpl.java:339)
at io.vertx.core.eventbus.impl.HandlerRegistration.deliver(HandlerRegistration.java:223)
at io.vertx.core.eventbus.impl.HandlerRegistration.handle(HandlerRegistration.java:200)
at io.vertx.core.eventbus.impl.EventBusImpl.lambda$deliverToHandler$3(EventBusImpl.java:533)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException: null
at io.netty.buffer.ByteBufInputStream.readByte(ByteBufInputStream.java:206)
at io.netty.buffer.ByteBufInputStream.readUnsignedByte(ByteBufInputStream.java:292)
at com.fasterxml.jackson.core.json.UTF8DataInputJsonParser._matchToken(UTF8DataInputJsonParser.java:2156)
at com.fasterxml.jackson.core.json.UTF8DataInputJsonParser._nextTokenNotInObject(UTF8DataInputJsonParser.java:690)
at com.fasterxml.jackson.core.json.UTF8DataInputJsonParser.nextToken(UTF8DataInputJsonParser.java:606)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3850)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3799)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2989)
at io.vertx.core.json.Json.decodeValue(Json.java:165)
... 17 common frames omitted
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#370>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AANxis0aoIn6HHxxEwv0FsRbkz9P674Kks5tysRZgaJpZM4T_atC>.
|
|
Seems to be happening any time the JsonObjectMessageCodec is trying to decode from wire where the payload is mapped from a null object. |
|
fixed by eclipse-vertx/vert.x#2450 |
Snippet:
// from EventBus handler: Message message
Object r = null;
message.reply(JsonObject.mapFrom(r));
This results in the following exception on the receiving service:
18-May-15 08:02:28:086 ERROR vert.x-eventloop-thread-1 i.v.c.i.ContextImpl:162 - Unhandled exception
io.vertx.core.json.DecodeException: Failed to decode:null
at io.vertx.core.json.Json.decodeValue(Json.java:167)
at io.vertx.core.json.JsonObject.fromBuffer(JsonObject.java:952)
at io.vertx.core.json.JsonObject.(JsonObject.java:72)
at io.vertx.core.eventbus.impl.codecs.JsonObjectMessageCodec.decodeFromWire(JsonObjectMessageCodec.java:34)
at io.vertx.core.eventbus.impl.codecs.JsonObjectMessageCodec.decodeFromWire(JsonObjectMessageCodec.java:21)
at io.vertx.core.eventbus.impl.clustered.ClusteredMessage.decodeBody(ClusteredMessage.java:181)
at io.vertx.core.eventbus.impl.clustered.ClusteredMessage.body(ClusteredMessage.java:88)
at io.vertx.core.eventbus.impl.EventBusImpl.lambda$convertHandler$1(EventBusImpl.java:339)
at io.vertx.core.eventbus.impl.HandlerRegistration.deliver(HandlerRegistration.java:223)
at io.vertx.core.eventbus.impl.HandlerRegistration.handle(HandlerRegistration.java:200)
at io.vertx.core.eventbus.impl.EventBusImpl.lambda$deliverToHandler$3(EventBusImpl.java:533)
at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:339)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463)
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:886)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException: null
at io.netty.buffer.ByteBufInputStream.readByte(ByteBufInputStream.java:206)
at io.netty.buffer.ByteBufInputStream.readUnsignedByte(ByteBufInputStream.java:292)
at com.fasterxml.jackson.core.json.UTF8DataInputJsonParser._matchToken(UTF8DataInputJsonParser.java:2156)
at com.fasterxml.jackson.core.json.UTF8DataInputJsonParser._nextTokenNotInObject(UTF8DataInputJsonParser.java:690)
at com.fasterxml.jackson.core.json.UTF8DataInputJsonParser.nextToken(UTF8DataInputJsonParser.java:606)
at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:3850)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3799)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2989)
at io.vertx.core.json.Json.decodeValue(Json.java:165)
... 17 common frames omitted