NoClassDefFoundError: org/codehaus/stax2/ri/Stax2WriterAdapter using jackson

I have a problem using jackson when I try to convert json to XML - full documentation .

My converting function -

public org.w3c.dom.Element jsonToXml(JsonNode json) throws JsonProcessingException, ParserConfigurationException{

org.w3c.dom.Element toReturn = null;

XmlMapper xmlMapper = new XmlMapper();

String jsonString = xmlMapper.writeValueAsString(json.toString());

javax.xml.parsers.DocumentBuilderFactory b = javax.xml.parsers.DocumentBuilderFactory.newInstance();

DocumentBuilder db = b.newDocumentBuilder();

Document doc = db.newDocument();

toReturn = doc.createElement(jsonString);

//return Element

return toReturn;


And getting this error - java.lang.NoClassDefFoundError: org/codehaus/stax2/ri/Stax2WriterAdapter, I do not any reference to Stax2WriterAdapter in my class.

Full error log - service SRVE0068E: Uncaught exception created in one of the service methods of the servlet GtoQuotesServlets in application...

Read More »

By: StackOverFlow - Wednesday, 14 March

Related Posts