title: How to debug JAXB unmarshalling?
body: <p>I'm running into a problem with JAXB unmarshalling.  I think I have it properly coded, but my unmarshalled object returns with null parameters.  Consequently, I am assuming that when unmarshalling, JAXB is not seeing the appropriate XML structure that it is expecting.  However, I do not get any error messages or any exceptions thrown.</p>
  
  <p>Is there anyway to step through the unmarshalling process to see exactly where/why it is failing to populate my object(s)?</p>
  
  <p>The actual unmarshalling code is fairly mundane:</p>
  
  <pre><code>public &lt;T&gt; T unmarshall(Node node, Class&lt;T&gt; clazz) throws JAXBException {
      // Creating an unmarshaller
      Unmarshaller u = JAXBContext.newInstance(clazz).createUnmarshaller();
  
      // unmarshal an instance node into  Java content
      return clazz.cast(u.unmarshal(node, clazz).getValue());
  }
  </code></pre>
  
  <p>However, when I call it, I get an object of type clazz returned (as expected), but unpopulated.</p>
  
  <p>The DOM object that I am trying to unmarshal is generated by a third party API.  I have already run into some extremely odd behaviours with the unmarshalling, which is why I would like to be able to debug the process.  For instance, if I try to unmarshal a sub-element within the DOM object (ie: doc.getByElementName("myElement").item(0)), it fails silently.  However, if I convert the document to a string, and reimport it into a new document, then it converts it fine.</p>
  
  <p>I am starting to get quite frustrated not knowing how to debug this issue.</p>
  
  <p>Thanks for any insights!</p>
  
  <p>Eric</p>