当我从1.3.0.M1升级spring cloud netflix时,我得到了jackson反序列化错误 - > 1.3.0.RELEASE。
我点击的帖子请求是
Received [POST /wms-mdm/catalog HTTP/1.1
Host: localhost:8093
Content-Type: application/json
Origin: http://localhost:8093
Accept-Encoding: gzip, deflate
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50
Referer: http://localhost:8093/wms-mdm/swagger-ui.html
Content-Length: 99
Accept-Language: en-us
使用数据
{
"clientCatalogId": "7",
"shortDescription": "Dummy Catalog",
"longDescription": "Dummy Catalog"
}]
我得到的错误是:
com.fasterxml.jackson.databind.JsonMappingException:找不到名为“id”的创建者属性(在com.gor.platform.mdm.core.pojo.Catalog类中) 在com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:270)〜[jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.DeserializationContext.reportMappingException(DeserializationContext.java:1234)〜[jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.addBeanProps(BeanDeserializerFactory.java:551)〜[jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:226)~ [jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:141)〜[jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:403)〜[jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:349)〜[jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:264)〜[jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)〜[jackson-databind-2.8.7.jar:2.8.7] at com.fasterxml.jackson.databind.deser.DeserializerCache.hasValueDeserializerFor(DeserializerCache.java:191)~ [jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.DeserializationContext.hasValueDeserializerFor(DeserializationContext.java:421)〜[jackson-databind-2.8.7.jar:2.8.7] 在com.fasterxml.jackson.databind.ObjectMapper.canDeserialize(ObjectMapper.java:2713)〜[jackson-databind-2.8.7.jar:2.8.7] 在org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.canRead(AbstractJackson2HttpMessageConverter.java:162)〜[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE] 在org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:195)[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE] 在org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:150)[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE] 在org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:128)[spring-webmvc-4.3.7.RELEASE.jar:4.3.7.RELEASE] 在org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:121)[spring-web-4.3.7.RELEASE.jar:4.3.7.RELEASE]
当我将netflix云降级为旧版本时,一切正常。有人可以帮忙吗?
答案 0 :(得分:0)
为jackson-databind 2.8.8添加显式依赖项解决了这个问题。看起来像2.8.7的一些问题