response to a get with : text, list on JSON objects.This class is used to tell to the server that there are REST services. An alternative is to declare a servlet in the web.xml. I have written a java REST web service using Apache cxf and spring framework. My service is correctly producing XML. But when I change from Media type from XML to JSON I get following output.