Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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);

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

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

like image 524
Reyjohn Avatar asked Aug 20 '14 20:08

Reyjohn


Video Answer


1 Answers

You need both jackson-databind and jackson-core on your classpath.

like image 73
Sotirios Delimanolis Avatar answered Sep 22 '22 00:09

Sotirios Delimanolis