title: Jackson exception on writeValueAsString method
body: <p>I am trying to integrate Jackson on my java code to convert object to Json and back. My project is a web application developed in for Tomcat7 and Java7. I just downloaded the last version (2.6.0) jars of Jackson and was trying to do convert an object to json.</p>
  
  <pre><code>String outJson ="";
  myobject p = new myobject ();
  ObjectMapper mapper = new ObjectMapper(); // can reuse, share globally
  try {
        outJson = mapper.writeValueAsString(p);
  } catch (Exception e) {
      out.println(e.toString());
  }
  </code></pre>
  
  <p>When I run this, I get an exception like this:</p>
  
  <pre><code>com.fasterxml.jackson.databind.JsonMappingException: (was java.lang.NullPointerException)
  </code></pre>
  
  <p>I have done the oposite way, converting from json to the object and the result was ok.</p>
  
  <p>After some research I found some references to posible dependency problem, but I can not find what I am missing. I have included the following jars, obtained from Maven repository:</p>
  
  <pre><code>jackson-annotations-2.6.0.jar
  jackson-core-2.6.0.jar
  jackson-databind-2.6.0.jar
  jackson-dataformat-smile-2.6.0.jar
  jackson-jaxrs-json-provider-2.6.0.jar
  jackson-module-jaxb-annotations-2.6.0.jar
  </code></pre>
  
  <p>Any ideas of what could be the problem?</p>