title: Unmarshal error in JAXB
body: <p>This is the generated code for "PersonType" class.</p>
  
  <pre><code>package demo;
  
  import java.util.ArrayList;
  import java.util.List;
  import javax.xml.bind.annotation.XmlAccessType;
  import javax.xml.bind.annotation.XmlAccessorType;
  import javax.xml.bind.annotation.XmlElement;
  import javax.xml.bind.annotation.XmlType;
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlType(name = "PersonType", propOrder = {
  "name",
  "address"
  })
  public class PersonType {
  
  @XmlElement(name = "Name", required = true)
  protected String name;
  @XmlElement(name = "Address", required = true)
  protected List&lt;AddressType&gt; address;
  
  public String getName() {
      return name;
  }
  
  
  public void setName(String value) {
      this.name = value;
  }
  
  
  public List&lt;AddressType&gt; getAddress() {
      if (address == null) {
          address = new ArrayList&lt;AddressType&gt;();
      }
      return this.address;
  }
  
  }
  </code></pre>
  
  <p>This is the generated code for "AddressType" class.</p>
  
  <pre><code>    package demo;
  
   import javax.xml.bind.annotation.XmlAccessType;
   import javax.xml.bind.annotation.XmlAccessorType;
   import javax.xml.bind.annotation.XmlElement;
   import javax.xml.bind.annotation.XmlSchemaType;
   import javax.xml.bind.annotation.XmlType;
  
   @XmlAccessorType(XmlAccessType.FIELD)
   @XmlType(name = "AddressType", propOrder = {
  "number",
  "street"
   })
  public class AddressType {
  
  @XmlElement(name = "Number")
  @XmlSchemaType(name = "unsignedInt")
  protected long number;
  @XmlElement(name = "Street", required = true)
  protected String street;
  
  
  public long getNumber() {
      return number;
  }
  
  
  public void setNumber(long value) {
      this.number = value;
  }
  
  
  public String getStreet() {
      return street;
  }
  
  public void setStreet(String value) {
      this.street = value;
  }
  
  }
  </code></pre>
  
  <p>This is the xml file I want to unmarshal</p>
  
  <pre><code>&lt;Person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="C:\JAXB Demo\demo.xsd"&gt;
    &lt;Name&gt;Sharon Krisher&lt;/Name&gt;
    &lt;Address&gt;
      &lt;Street&gt;Iben Gevirol&lt;/Street&gt;
      &lt;Number&gt;57&lt;/Number&gt;
    &lt;/Address&gt;
  &lt;Address&gt;
    &lt;Street&gt;Moshe Sharet&lt;/Street&gt;
     &lt;Number&gt;89&lt;/Number&gt;
    &lt;/Address&gt;
  &lt;/Person&gt;
  </code></pre>
  
  <p>Code foe unarchall </p>
  
  <pre><code>JAXBContext context = JAXBContext.newInstance(PersonType.class);
      Unmarshaller unmarshaller =context.createUnmarshaller();
      //unmarshaller.setValidating(true);
      PersonType person =(PersonType) unmarshaller.unmarshal(new File("C:\\Users\\sithi\\workspace\\TestJAXB\\src\\data.xml") );
  </code></pre>
  
  <p>This code gives an exception:</p>
  
  <pre><code>Exception in thread "main" javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"PersonType"). Expected elements are (none)
  </code></pre>