我采用了 java 流客户端 ( https://github.com/GetStream/stream-java ) 附带的 MixedType 示例代码,并使用 updateActivities 添加了更新步骤。更新后,存储在流中的活动会丢失“类型”属性。当您再次获得活动并且正在反序列化活动时,Jackson 会使用此属性。
所以我得到:
Exception in thread "main" Disconnected from the target VM, address: '127.0.0.1:60016', transport: 'socket'
com.fasterxml.jackson.databind.JsonMappingException: Could not resolve type id 'null' into a subtype of [simple type, class io.getstream.client.apache.example.mixtype.MixedType$Match]
at [Source: org.apache.http.client.entity.LazyDecompressingInputStream@29ad44e3; line: 1, column: 619] (through reference chain: io.getstream.client.model.beans.StreamResponse["results"]->java.util.ArrayList[1])
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:148)
at com.fasterxml.jackson.databind.DeserializationContext.unknownTypeException(DeserializationContext.java:849)
请参阅此处我更新了示例:
知道这里发生了什么吗?