In Liberty 126.96.36.199, is there any way to configure the JAXB marshaller to use JSON (in the context of a pure OSGi bundle)?
I am writing an OSGi service that itself consumes a JSON-based REST API. I'd like to try and use JAXB annotated classes and manually marshal/unmarshal the JSON. This works OK for XML, but I can't find a way to ask for JSON. Eclipselink uses the "eclipselink.media-type" property to achieve this. Is there a way do this with WLP855 out-of-the-box?
Something like this:
JAXBContext context = JAXBContext.newInstance(MyBean.class);
Marshaller m = context.createMarshaller();
would be nice.
I've also tried using the Jackson ObjectMapper which is present in the jaxrs jar under dev/api/third-party - but it appears this only works in an EE context - whereas what I'm looking for us something usable inside an OSGi bundle.