title: How to figure the actual class when java.lang.ClassCastException occurs?
body: <p>Is it possible to figure out at all?</p>
  
  <p>The runtime information should be available; otherwise, Java shouldn't be able to detect the problem.</p>
  
  <p>Here the the snippet:</p>
  
  <pre>
  <code>
          m_jaxbCxt = JAXBContext.newInstance("generated");
          m_unMarshaller = m_jaxbCxt.createUnmarshaller();
          Model model = (Model)m_unMarshaller.unmarshal(new File(xmlName));
  </code>
  </pre>
  
  <p>The exception:</p>
  
  <pre>
  <code>
  Exception in thread "main" java.lang.ClassCastException: javax.xml.bind.JAXBElement cannot be cast to generated.Model
  </code>
  </pre>
  
  <p>Thanks in advance.</p>