title: Exception in thread "main" javax.xml.bind.PropertyException: name: eclipselink.media-type value: application/json
body: <p>I'm attempting to follow the example located <a href="https://stackoverflow.com/questions/14734741/converting-json-to-xml-and-vice-versa-using-jackson-api-and-jaxb-annotation">here</a> but get an javax.xml.bind.PropertyException. I receive this exception because of the following line of code:</p>
  
  <pre><code>marshaller.setProperty(MarshallerProperties.MEDIA_TYPE, "application/json");
  </code></pre>
  
  <p>I have literally copy/pasted the example listed above so my code is exactly what you see there. Searching SO and Google for this has not been helpful, and thought I'd bring this to the geniuses at SO for some help. Any help would be most appreciated, (de)serialization with JSON and XML with json.org, Jackson, and JAXB has turned into a black and bottomless pit that has consumed almost a month of my life.</p>
  
  <p>My first impression was that I wasn't properly specifying the eclipselink runtime (<a href="http://www.eclipse.org/eclipselink/documentation/2.4/moxy/runtime001.htm#CACFEGHC" rel="noreferrer">as described here</a>) but that didn't produce a solution.</p>
  
  <p>Stacktrace:</p>
  
  <pre><code>Exception in thread "main" javax.xml.bind.PropertyException: name: eclipselink.media-type value: application/json
     at javax.xml.bind.helpers.AbstractMarshallerImpl.setProperty(AbstractMarshallerImpl.java:358)
     at com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.setProperty(MarshallerImpl.java:527)
     at HelloWorld.main(HelloWorld.java:17)
  </code></pre>
  
  <p>This is what I'm doing,</p>
  
  <p><img src="https://i.stack.imgur.com/3tDH1.png" alt="enter image description here"></p>