File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

javax.xml.bind.UnmarshalException: unexpected element (uri:"

Suresh Sudineni
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i have generated javaclasses from XSD through JAXB. and now i want to convet my Xml to JAXB to do the xml validations.

can anyone send me the solution for below Exception

javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"orderRequest"). Expected elements are <{}WSCallback>,<{}WSContext>,<{}WSConversationId>,<{}WSCorrelationId>,<{}WSEndUserToken>,<{}WSEnterpriseLogging>,<{}WSException>,<{}WSHeader>,<{}WSMessageData>,<{}WSResponseHeader>,<{}WSResponseMessageExpiration>,<{}deliveryAcknowledgement>,<{}modifyEquipmentStatusResponse>
at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(Unknown Source) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Loader.reportError(Unknown Source)

i am using below code

JAXBContext jc1 = JAXBContext.newInstance("com.att.erp_epic.commondata");
Unmarshaller unmarshal = jc1.createUnmarshaller();
Object output = unmarshal.unmarshal(new StreamSource(new StringReader(xmlMessage)));
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic