I am trying to follow the example here , but getting a javax.xml.bind.PropertyException. I get this exception due to the following line of code:
marshaller.setProperty("eclipselink.media-type", "application/json");
I literally copied / pasted the above example, so my code is exactly what you see there. Finding SO and Google did not help for this, and I thought I would bring this genius to SO for some help. Any help would be most appreciated, (de) serialization with JSON and XML from json.org, Jackson and JAXB turned into a black and bottomless pit that consumed almost a month of my life.
My first impression was that I did not correctly specify eclipselink runtime (as described here) , but that did not create a solution,
Stacktrace:
Exception in thread "main" javax.xml.bind.PropertyException: name: eclipselink.media-type value: application/json at org.eclipse.persistence.jaxb.JAXBMarshaller.setProperty(JAXBMarshaller.java:528) at com.dualoutput.DualOutput.main(DualOutput.java:20)
Sscce
source share