com.fasterxml.jackson.databind.Moudle 支持1.7jdk的版本有哪些
时间: 2024-05-31 10:08:39 浏览: 246
根据官方文档,com.fasterxml.jackson.databind.Module 支持的 JDK 版本为 1.6+,因此支持 1.7 JDK 的版本应该包括:
- Jackson 2.0.x
- Jackson 2.1.x
- Jackson 2.2.x
- Jackson 2.3.x
但需要注意的是,Jackson 2.0.x 和 2.1.x 的最低要求为 JDK 1.6,不支持 JDK 1.5。
相关问题
Caused by: org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonParseException: Unexpected character ('i' (code 105)): was expecting double-quote to start field name at [Source: (byte[])"{id:1,name:luli}"; line: 1, column: 3] at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:1840) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:712) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:637) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleOddName(UTF8StreamJsonParser.java:2020) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.json.UTF8StreamJsonParser._parseName(UTF8StreamJsonParser.java:1671) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextFieldName(UTF8StreamJsonParser.java:1029) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.deser.std.BaseNodeDeserializer.deserializeObject(JsonNodeDeserializer.java:249) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:68) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.deser.std.JsonNodeDeserializer.deserialize(JsonNodeDeserializer.java:15) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper._readTreeAndClose(ObjectMapper.java:4254) at org.apache.flink.shaded.jackson2.com.fasterxml.jackson.databind.ObjectMapper.readTree(ObjectMapper.java:2725) at org.apache.flink.formats.json.JsonRowDataDeserializationSchema.deserialize(JsonRowDataDeserializationSchema.java:103)
这个错误是由于在解析 json 字符串时,出现了一个意外的字符 'i',而解析器期望的是双引号来开始一个字段名。你需要检查一下你的 json 字符串格式,保证它是一个合法的 json 格式。你可能需要检查一下 json 字符串中的字段名是否用双引号括起来,字段名和值之间是否用冒号分隔,字段之间是否用逗号分隔。
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class java.io.ByteArrayInputStream and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.alibaba.fastjson.JSONObject["file"]->org.springframework.core.io.ByteArrayResource["inputStream"]) at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:284) at com.fasterxml.jackson.databind.SerializerProvider.mappingException(SerializerProvider.java:1110) at com.fasterxml.jackson.databind.SerializerProvider.reportMappingProblem(SerializerProvider.java:1135) at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:69) at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:32) at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:704) at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:689) at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155) at com.fasterxml.jackson.databind.ser.std.MapSerializer.serializeFields(MapSerializer.java:633) at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:536) at com.fasterxml.jackson.databind.ser.std.MapSerializer.serialize(MapSerializer.java:30) at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:292) at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:2509) at org.springframework.http.converter.json.MappingJackson2HttpMessageConverter.writeInternal(MappingJackson2HttpMessageConverter.java:141)
这个错误是由于FastJson序列化JSONObject对象时,其中的文件类型是一个java.io.ByteArrayInputStream对象,而FastJson并不支持这种类型的序列化。解决方法可以尝试禁用序列化特性SerializationFeature.FAIL_ON_EMPTY_BEANS,或者使用其他支持java.io.ByteArrayInputStream序列化的JSON库。
阅读全文