com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"])

Spring JIRA | Prashant Deva | 2 years ago
  1. 0

    This code: {code} public static void main(String[] args) throws IOException { GlobalMetricID txnID = new GlobalMetricID(); txnID.appId = new ObjectId("530a4bf1fe0e15115a197577"); txnID.metricId = 1; txnID.metricName = "hello"; Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer(GlobalMetricID.class); byte[] bytes = serializer.serialize(txnID); String s1 = new String(bytes); System.out.println(s1); Object deserialize = serializer.deserialize(bytes); System.out.println(deserialize); } {code} results in this {code} {"appId":{"time":1393183729000,"date":1393183729000,"timestamp":1393183729,"machine":-32631535,"timeSecond":1393183729,"new":false,"inc":1511617911},"metricName":"hello","metricId":1,"name":"hello"} Exception in thread "main" org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"]); nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"]) at org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer.deserialize(Jackson2JsonRedisSerializer.java:73) at com.dripstat.metricprocessor.metric.caches.MetricIdCache.main(MetricIdCache.java:120) Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51) at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:731) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:915) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1298) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1276) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:243) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:538) at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:106) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:238) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2255) at org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer.deserialize(Jackson2JsonRedisSerializer.java:71) ... 1 more {code} This means anyone trying to cache mongodb documents using redis will face this exception. This is a critical exception since the error is thrown during deserialization, so users will fill up their cache with data that cannot be serialized

    Spring JIRA | 2 years ago | Prashant Deva
    com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"])
  2. 0

    This code: {code} public static void main(String[] args) throws IOException { GlobalMetricID txnID = new GlobalMetricID(); txnID.appId = new ObjectId("530a4bf1fe0e15115a197577"); txnID.metricId = 1; txnID.metricName = "hello"; Jackson2JsonRedisSerializer serializer = new Jackson2JsonRedisSerializer(GlobalMetricID.class); byte[] bytes = serializer.serialize(txnID); String s1 = new String(bytes); System.out.println(s1); Object deserialize = serializer.deserialize(bytes); System.out.println(deserialize); } {code} results in this {code} {"appId":{"time":1393183729000,"date":1393183729000,"timestamp":1393183729,"machine":-32631535,"timeSecond":1393183729,"new":false,"inc":1511617911},"metricName":"hello","metricId":1,"name":"hello"} Exception in thread "main" org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"]); nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"]) at org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer.deserialize(Jackson2JsonRedisSerializer.java:73) at com.dripstat.metricprocessor.metric.caches.MetricIdCache.main(MetricIdCache.java:120) Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"]) at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51) at com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:731) at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:915) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1298) at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1276) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:243) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118) at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:538) at com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:106) at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:238) at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118) at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051) at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2255) at org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer.deserialize(Jackson2JsonRedisSerializer.java:71) ... 1 more {code} This means anyone trying to cache mongodb documents using redis will face this exception. This is a critical exception since the error is thrown during deserialization, so users will fill up their cache with data that cannot be serialized

    Spring JIRA | 2 years ago | Prashant Deva
    com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"])
  3. 0

    Cannot override the Jackson StackTraceElement deserializer

    GitHub | 3 years ago | garydgregory
    com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "class" (class java.lang.StackTraceElement), not marked as ignorable at [Source: java.io.StringReader@32b427c1; line: 1, column: 11] (through reference chain: java.lang.StackTraceElement["class"])
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Cannot saved changed name after creating scenario

    GitHub | 2 years ago | mattwigway
    com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "status" (class models.Scenario), not marked as ignorable (9 known properties: "name", "processingGtfs", "projectId", "bounds", "processingOsm", "files", "id", "description", "failed"]) at [Source: N/A; line: -1, column: -1] (through reference chain: models.Scenario["status"])
  6. 0

    email_output plugin isn't functional for V0.20.0-rc.1

    GitHub | 3 years ago | pilot2d
    com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "shortname" (class org.graylog2.plugins.PluginApiResponse), not marked as ignorable (0 known properties: ]) at [Source: java.io.StringReader@468bfb47; line: 1, column: 15] (through reference chain: org.graylog2.plugins.PluginApiResponse["shortname"])

  1. tyson925 15 times, last 4 weeks ago
  2. kjhdofjosvs 18 times, last 4 days ago
  3. davidvanlaatum 2 times, last 4 months ago
  4. tyson925 3 times, last 4 months ago
  5. Nikolay Rybak 1 times, last 5 months ago
4 more registered users
7 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException

    Unrecognized field "time" (class org.bson.types.ObjectId), not marked as ignorable (0 known properties: ]) at [Source: [B@4387b79e; line: 1, column: 31] (through reference chain: com.dripstat.metricprocessor.mongo.GlobalMetricID["appId"]->org.bson.types.ObjectId["time"])

    at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from()
  2. Jackson
    ObjectMapper.readValue
    1. com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:51)
    2. com.fasterxml.jackson.databind.DeserializationContext.reportUnknownProperty(DeserializationContext.java:731)
    3. com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:915)
    4. com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1298)
    5. com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1276)
    6. com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:243)
    7. com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118)
    8. com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:538)
    9. com.fasterxml.jackson.databind.deser.impl.FieldProperty.deserializeAndSet(FieldProperty.java:106)
    10. com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:238)
    11. com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:118)
    12. com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3051)
    13. com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2255)
    13 frames
  3. Spring Data Redis
    Jackson2JsonRedisSerializer.deserialize
    1. org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer.deserialize(Jackson2JsonRedisSerializer.java:71)
    1 frame
  4. com.dripstat.metricprocessor
    MetricIdCache.main
    1. com.dripstat.metricprocessor.metric.caches.MetricIdCache.main(MetricIdCache.java:120)
    1 frame