spring 哪个 JAR 文件包含 JsonProcessingException 类?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14423638/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 05:39:15  来源:igfitidea点击:

Which JAR file contains the JsonProcessingException class?

springspring-mvcjarHymanson

提问by Tiny

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

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

  • Hymanson-core-2.1.1.jar
  • Hymanson-annotations-2.1.1.jar
  • Hymanson-databind-2.1.1.jar
  • Hyman逊核心2.1.1.jar
  • Hymanson-annotations-2.1.1.jar
  • Hyman逊-数据绑定-2.1.1.jar

I get the following exception.

我得到以下异常。

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

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

So I think, the class JsonProcessingExceptionis contained by the Hymanson-core-asl-2.1.1.jarfile (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?

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



Hymanson-all-1.9.8.jarcontains necessary classes including the class org.codehaus.Hymanson.JsonProcessingExceptionand JSON also works fine but I'm not sure this is perfectly compatible as I'm using classes from Hymanson 2.1.1 for object mapping. Therefore I'm looking for the Hymanson-core-asl-2.1.1.jarfile but I can't see such a JAR file. I can only see 1.x.xversions here.

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

回答by Tom Anderson

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

在 2.1.2 版本中,该类称为com.fasterxml.Hymanson.core.JsonProcessingException,它位于 Hymanson-core jar 中。Hymanson更改了版本 2.0 的包装以及许多其他内容。

It seems you have some code that was written against an older version of Hymanson, 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 Hymanson.

您似乎有一些针对旧版本 Hymanson 编写的代码,并试图以旧名称加载该类。您将需要更新此代码,或使用旧版本的 Hymanson。

回答by Aarya

Use Hymanson-all-1.9.9 jar instead of the later versions(2.x.x.) of Hymanson-core, Hymanson-annotations and Hymanson-databind. Here is the link.

使用 Hymanson-all-1.9.9 jar 而不是 Hymanson-core、Hymanson-annotations 和 Hymanson-databind 的更高版本(2.xx)。这是链接