title: JAXB to JSON using JACKSON
body: <p>In my application the JAXB output generates like:</p>
  
  <p><code>this.marshalOut(jaxb_Object, fileOutputStream);</code> </p>
  
  <p>this is method call to the spring Object XML Mapping Marshallers that generate XML files. Now, I also like to generate JSON files after this line. Any one have idea about generating JSON output using JAXB input. </p>
  
  <p>I found this example code online:</p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper();
  AnnotationIntrospector introspector = new JacksonAnnotationIntrospector();
  // make deserializer use JAXB annotations (only)
  mapper.getDeserializationConfig().setAnnotationIntrospector(introspector);
  // make serializer use JAXB annotations (only)
  mapper.getSerializationConfig().setAnnotationIntrospector(introspector);
  mapper.writeValue( outputStream, jaxb_object);
  </code></pre>
  
  <p>The <code>setAnnotationIntrospector</code> is deprecated, is there any other way of solving this problem? </p>