链接:http://www.jsjtt.com/java/JavaWebkaifa/93.html
在使用jackson 进行json字符串转java bean的时候出现如下错误,
com.fasterxml.jackson.databind.JsonMappingException: No suitable constructor found for type [simple type, class org.test.Library]: can not instantiate from JSON object (need to add/enable type information?) at [Source: java.io.StringReader@d1831; line: 1, column: 2]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:983)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:276)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:121)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2888)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2034)
原因java bean中没有提供无参的构造函数.