title: JAXB Unmarshall exception - unexpected element
body: <p>I have used a .xsd file to generate Java classes, and with an XML file, I need to unmarshall.</p>
  
  <p>I am using this code :</p>
  
  <pre><code>JAXBContext objJAXBContext = JAXBContext.newInstance("my.test");
  
  // create an Unmarshaller
  Unmarshaller objUnmarshaller = objJAXBContext.createUnmarshaller();
  
  FileInputStream fis = new FileInputStream("test.xml");
  
  JAXBElement&lt;Root&gt; objMyRoot = (JAXBElement&lt;Root&gt;) objUnmarshaller.unmarshal(fis);
  
  Root mRoot = objMyRoot.getValue();
  </code></pre>
  
  <p>and I am getting this error: </p>
  
  <pre><code>javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"Root"). Expected elements are (none)
  </code></pre>
  
  <p>I have seen many solutions but nothing works in my project.</p>
  
  <p>What i can try to do?</p>