com.fasterxml.jackson.core.JsonGenerator类型无法解析。它是从所需的.class文件间接引用的 [英] The type com.fasterxml.jackson.core.JsonGenerator cannot be resolved. It is indirectly referenced from required .class files

查看:1982
本文介绍了com.fasterxml.jackson.core.JsonGenerator类型无法解析。它是从所需的.class文件间接引用的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里我在我的eclipse项目中使用Jackson数据绑定器2.4.1 jar库将对象转换为json格式。这是我的代码:

Here I am using Jackson data binder 2.4.1 jar library in my eclipse project to convert an object to a json format. And here is my code:

ObjectMapper mapper = new ObjectMapper();
DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
mapper.writeValue(wr, content);

但最后一行 mapper.writeValue(wr,content); 它会出现错误说

but in the last line mapper.writeValue(wr, content); it gives an error saying

The type com.fasterxml.jackson.core.JsonGenerator cannot be resolved. It is indirectly referenced from required .class files



<依赖于不可用的另一个类,则会发生这种类型的错误。但是从我使用这个代码段的地方,没有这样的问题。但是我通过更改JAR版本失败了很多时间,但没有解决这个问题。如何解决这个问题,请帮助

I have studied and found that when a jar file's class is dependent on another class which is unavailable then this type of error occurs. But from where I am using this code snippet there is no issue like this. But I have failed a lot of time by changing the JAR version but nothing solved this issue. How can I solve this, please help

推荐答案

您需要 jackson-databind jackson-core

这篇关于com.fasterxml.jackson.core.JsonGenerator类型无法解析。它是从所需的.class文件间接引用的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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