360SDN.COM

Spring 4 版本和Jackson版本兼容问题

来源:  2018-09-06 20:12:13    评论:0点击:

Spring 4.2版本与jackson 2.2不兼容,在JWT业务是会报错:
Exception in thread "main" java.lang.NoSuchMethodError: com.fasterxml.jackson.databind.JsonNode.asText(Ljava/lang/String;)Ljava/lang/String;

Spring 4.2 使用 jackson 2.6 没有兼容问题(亲测)
 


  • jackson-annotations-2.6.2.jar
  •  
    jackson-core-2.6.2.jar
  •  
    jackson-databind-2.6.2.jar
  •  
    jackson-mapper-asl-1.9.13.jar

     

jackson jar:

jackson-annotations-2.6.2.jar
jackson-core-2.6.2.jar
jackson-databind-2.6.2.jar
jackson-mapper-asl-1.9.13.jar

maven引用jackson的包:

<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-core</artifactId>
			<version>2.9.6</version>
		</dependency>
		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-annotations</artifactId>
			<version>2.9.6</version>
		</dependency>

		<dependency>
			<groupId>com.fasterxml.jackson.core</groupId>
			<artifactId>jackson-databind</artifactId>
			<version>2.9.6</version>
		</dependency>

		<dependency>
			<groupId>org.codehaus.jackson</groupId>
			<artifactId>jackson-mapper-asl</artifactId>
			<version>1.9.13</version>
		</dependency>
为您推荐

友情链接 |九搜汽车网 |手机ok生活信息网|ok生活信息网|ok微生活
 Powered by www.360SDN.COM   京ICP备11022651号-4 © 2012-2016 版权