title: org.xmlpull.v1.XmlPullParserException
body: <p>I'm trying to bind an xml file(as a <code>byte[]</code>) to a java object. This is my code-</p>
  
  <pre><code>public voidinputConfigXML(String xmlfile, byte[] xmlData) {
      IBindingFactory bFact = BindingDirectory.getFactory(GroupsDTO.class);
                  IUnmarshallingContext uctx = bFact.createUnmarshallingContext();
                  groups = (GroupsDTO) uctx.unmarshalDocument(new ByteArrayInputStream(xmlData), "UTF8");
  }
  </code></pre>
  
  <p>The <code>unmarshalDocument()</code> is giving me this exception. What do i do?</p>
  
  <p><strong>FYI: Running as JUnit test case</strong></p>
  
  <p>The following is the stacktrace -</p>
  
  <pre><code>    Error parsing document (line 1, col 1)
      org.xmlpull.v1.XmlPullParserException: only whitespace content allowed before start tag and not \u0 (position: START_DOCUMENT seen \u0... @1:1) 
          at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1519)
          at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395)
          at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
          at org.jibx.runtime.impl.XMLPullReaderFactory$XMLPullReader.next(XMLPullReaderFactory.java:291)
          at org.jibx.runtime.impl.UnmarshallingContext.toStart(UnmarshallingContext.java:451)
          at org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(UnmarshallingContext.java:2755)
          at org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(UnmarshallingContext.java:2905)
          at abc.dra.DRAAPI.inputConfigXML(DRAAPI.java:31)
          at abc.dra.XMLToObject_Test.test(XMLToObject_Test.java:34)
          [...]
  </code></pre>
  
  <p>This is my code that forms byte[]-</p>
  
  <pre><code>void test() {
  String xmlfile = "output.xml"
  File file = new File(xmlfile);
  byte[] xmlData = new byte[(int) file.length()];
  groups = dra.inputConfigXML(xmlfile, xmlData);
  }
  </code></pre>