title: The type com.fasterxml.jackson.core.JsonGenerator cannot be resolved. It is indirectly referenced from required .class files
body: <p>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:</p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper();
  DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
  mapper.writeValue(wr, content);
  </code></pre>
  
  <p>but in the last line <code>mapper.writeValue(wr, content);</code> it gives an error saying</p>
  
  <pre><code>The type com.fasterxml.jackson.core.JsonGenerator cannot be resolved. It is indirectly referenced from required .class files
  </code></pre>
  
  <p>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</p>