XML unable to create JAXBContext on marshal [duplicate]
问题 This question already has an answer here : JAXBContext and @XmlRootElement cause error (1 answer) Closed last year . I have a POJO(in Kotlin) that I wanted to change into XML but i having problem going through the JAXBContext.newInstance(myObj::class.java) part Just view/reply it in Java/Kotlin also can Here's my code on marshalling val context = JAXBContext.newInstance(WxPayOrder::class.java) val m = context.createMarshaller() m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true) val sw =