You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had searched in the issues and found no similar issues.
Environment
Windows
EventMesh version
master
What happened
final Map<String, Object> content = new HashMap<>();
content.put("content", "testAsyncMessage");
content.put("content", LocalDate.now());
JsonUtils.toJSONString(content)
throw exception
How to reproduce
final Map<String, Object> content = new HashMap<>();
content.put("content", "testAsyncMessage");
content.put("content", LocalDate.now());
JsonUtils.toJSONString(content)
Debug logs
Exception in thread "main" org.apache.eventmesh.common.exception.JsonException: serialize to json error
at org.apache.eventmesh.common.utils.JsonUtils.toJSONString(JsonUtils.java:66)
at org.apache.eventmesh.grpc.GrpcAbstractDemo.buildEventMeshMessage(GrpcAbstractDemo.java:71)
at org.apache.eventmesh.grpc.pub.eventmeshmessage.AsyncPublishInstance.main(AsyncPublishInstance.java:49)
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.LocalDate` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: java.util.HashMap["content"])
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1300)
at com.fasterxml.jackson.databind.ser.impl.UnsupportedTypeSerializer.serialize(UnsupportedTypeSerializer.java:35)
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeOptionalFields(MapSerializer.java:869)
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeWithoutTypeInfo(MapSerializer.java:760)
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:720)
at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:35)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4569)
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:3822)
at org.apache.eventmesh.common.utils.JsonUtils.toJSONString(JsonUtils.java:64)
... 2 more
Are you willing to submit PR?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered:
Search before asking
Environment
Windows
EventMesh version
master
What happened
throw exception
How to reproduce
Debug logs
Are you willing to submit PR?
The text was updated successfully, but these errors were encountered: