JiBXException: Error accessing document

September 23, 2010

I got this error when using jibx-soap to call a web service, with jibx used to marshall and unmarshall the xml for transport.

org.jibx.soap.SOAPException: Error unmarshalling message  
Root cause: org.jibx.runtime.JiBXException: Error accessing document
  org.jibx.soap.SOAPContext.unmarshalSOAP(SOAPContext.java:254)
  org.jibx.soap.client.SOAPClient.call(SOAPClient.java:170)
  org.jibx.soap.client.SOAPClient.call(SOAPClient.java:213)

org.jibx.runtime.JiBXException: Error accessing document
  org.jibx.runtime.impl.XMLPullReaderFactory$XMLPullReader.next(XMLPullReaderFactory.java:281)
  org.jibx.runtime.impl.UnmarshallingContext.toStart(UnmarshallingContext.java:508)
  org.jibx.soap.SOAPContext.unmarshalSOAP(SOAPContext.java:184)
  org.jibx.soap.client.SOAPClient.call(SOAPClient.java:170)
  org.jibx.soap.client.SOAPClient.call(SOAPClient.java:213)

The root cause of the problem was that I wasn't actually calling the web service I thought I was - the call was being made to a different URL, which was probably resulting in a 404. Therefore the code was trying to read XML from the response and not finding any.

Tags: jibx xml java