spring与jackson包版本冲突

spring5.x需要匹配jackson2.9.x的包,如果匹配的jackson版本过低,会导致controller返回的对象不能解析。

这种错:java.lang.ClassNotFoundException: com.fasterxml.jackson.core.util.DefaultPrettyPrinter$Indenter

这种:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.http.converter.json.MappingJackson2HttpMessageConverter#0': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [org.springframework.http.converter.json.MappingJackson2HttpMessageConverter] from ClassLoader [WebappClassLoader
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

总之挺恶心的。这里记一笔。

你可能感兴趣的:(spring与jackson包版本冲突)