哪个 JAR 文件包含 JsonProcessingException 类? [英] Which JAR file contains the JsonProcessingException class?

查看:34
本文介绍了哪个 JAR 文件包含 JsonProcessingException 类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试将 Jackson 2.1.1 与以下 jar 文件(在 Spring 3.2.2 中)一起使用时,

When I try to use Jackson 2.1.1 with the following jar files (in Spring 3.2.2),

  • jackson-core-2.1.1.jar
  • jackson-annotations-2.1.1.jar
  • jackson-databind-2.1.1.jar

我收到以下异常.

java.lang.ClassNotFoundException:org.codehaus.jackson.JsonProcessingException

java.lang.ClassNotFoundException: org.codehaus.jackson.JsonProcessingException

所以我认为,JsonProcessingException 类包含在 jackson-core-asl-2.1.1.jar 文件中(虽然我不太确定)但是我在 下载 中看不到此文件.那么从哪里获取该文件来解决该异常?

So I think, the class JsonProcessingException is contained by the jackson-core-asl-2.1.1.jar file (I'm not quite sure though) but I cannot see this file in the download. So where to get this file to resolve that exception?

jackson-all-1.9.8.jar 包含必要的类,包括 org.codehaus.jackson.JsonProcessingException 和 JSON 也可以正常工作,但我不确定这是否完全兼容,因为我使用的是 Jackson 2.1.1 中的类对象映射.因此,我正在寻找 jackson-core-asl-2.1.1.jar 文件,但我看不到这样的 JAR 文件.我只能在这里看到1.xx版本.

jackson-all-1.9.8.jar contains necessary classes including the class org.codehaus.jackson.JsonProcessingException and JSON also works fine but I'm not sure this is perfectly compatible as I'm using classes from Jackson 2.1.1 for object mapping. Therefore I'm looking for the jackson-core-asl-2.1.1.jar file but I can't see such a JAR file. I can only see 1.x.x versions here.

推荐答案

在 2.1.2 版本中,该类称为 com.fasterxml.jackson.core.JsonProcessingException,它在 jackson-核心罐.Jackson 更改了 2.0 版的包装,以及许多其他内容.

In version 2.1.2, that class is called com.fasterxml.jackson.core.JsonProcessingException, and it's in the jackson-core jar. Jackson changed its packaging for version 2.0, along with numerous other things.

您似乎有一些针对旧版本 Jackson 编写的代码,并且正在尝试以旧名称加载该类.您需要更新此代码,或使用旧版本的 Jackson.

It seems you have some code that was written against an older version of Jackson, and is trying to load the class under an old name. You will need to either update this code, or use an old version of Jackson.

这篇关于哪个 JAR 文件包含 JsonProcessingException 类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆