title: Jaxb, Class has two properties of the same name
body: <p>with jaxb, i try to read an xml file
  only a few element in xml file are interesting, so i would like to skip many element</p>
  
  <p><a href="http://www.copypastecode.com/75029/" rel="noreferrer">xml content</a></p>
  
  <p>xml i try to read</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!--Sample XML file generated by XMLSpy v2010 rel. 3 sp1 (http://www.altova.com)--&gt;
  &lt;flx:ModeleREP xsi:schemaLocation="urn:test:mod_rep.xsd mod_rep.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:flx="urn:test:mod_rep.xsd"&gt;
  &lt;flx:DocumentHeader&gt;
      &lt;flx:Identification v="04489"/&gt;
  &lt;/flx:DocumentHeader&gt;
  &lt;flx:TimeSeries&gt;
      &lt;flx:Identification v="test1a"/&gt;
      &lt;flx:BusinessType v="A01"/&gt;
      &lt;flx:Product v="123a"/&gt;
      &lt;flx:ResourceObject codingScheme="N" v="testa"/&gt;
      &lt;flx:Period&gt;
          &lt;flx:TimeInterval v="2011-07-02T00:00/2011-07-16T00:00"/&gt;
          &lt;flx:Resolution v="PT2H"/&gt;
          &lt;flx:Pt&gt;
              &lt;flx:P v="1"/&gt;
              &lt;flx:Q unitCode="String" v="1.0"/&gt;
              &lt;flx:A currencyIdentifier="String" v="195.0"/&gt;
          &lt;/flx:Pt&gt;
      &lt;/flx:Period&gt;
  &lt;/flx:TimeSeries&gt;
  &lt;flx:TimeSeries&gt;
      &lt;flx:Identification v="test2a"/&gt;
      &lt;flx:BusinessType v="A01"/&gt;
      &lt;flx:Product v="a123b"/&gt;
      &lt;flx:ResourceObject codingScheme="N" v="test2"/&gt;
      &lt;flx:Period&gt;
          &lt;flx:TimeInterval v="2011-07-02T00:00/2011-07-16T00:00"/&gt;
          &lt;flx:Resolution v="PT2H"/&gt;
          &lt;flx:Pt&gt;
              &lt;flx:P v="1"/&gt;
              &lt;flx:Q unitCode="String" v="1.0"/&gt;
              &lt;flx:A currencyIdentifier="String" v="195.0"/&gt;
          &lt;/flx:Pt&gt;
          &lt;flx:Pt&gt;
              &lt;flx:P v="2"/&gt;
              &lt;flx:Q unitCode="String" v="1.0"/&gt;
              &lt;flx:A currencyIdentifier="String" v="195.0"/&gt;
          &lt;/flx:Pt&gt;
      &lt;/flx:Period&gt;
  &lt;/flx:TimeSeries&gt;
  &lt;/flx:ModeleREP&gt;
  </code></pre>
  
  <p>my class</p>
  
  <pre><code>@XmlRootElement(name="ModeleREP", namespace="urn:test:mod_rep.xsd")
  public class ModeleREP {
  
    @XmlElement(name="TimeSeries")
    protected List&lt;TimeSeries&gt; timeSeries;
  
    public List&lt;TimeSeries&gt; getTimeSeries() {
    if (this.timeSeries == null) {
        this.timeSeries = new ArrayList&lt;TimeSeries&gt;();
    }
    return this.timeSeries;
    }
  
    public void setTimeSeries(List&lt;TimeSeries&gt; timeSeries) {
    this.timeSeries = timeSeries;
    }
  
  }
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "TimeSeries")
  public class TimeSeries {
  
  @XmlElement(name="ResourceObject")
  protected RessourceObject resourceObject;
  
  @XmlElement(name = "Period")
  protected Period period;
  
  public RessourceObject getResourceObject() {
      return this.resourceObject;
  }
  
  public void setResourceObject(RessourceObject resourceObject) {
      this.resourceObject = resourceObject;
  }
  
  public Period getPeriod() {
      return this.period;
  }
  
  public void setPeriod(Period period) {
      this.period = period;
  }
  
  }
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "ResourceObject")
  
  public class RessourceObject {
  @XmlAttribute(name = "codingScheme")
  protected String codingScheme;
  
  @XmlAttribute(name = "v")
  protected String v;
  
  public String getCodingScheme() {
      return this.codingScheme;
  }
  
  public void setCodingScheme(String codingScheme) {
      this.codingScheme = codingScheme;
  }
  
  public String getV() {
      return this.v;
  }
  
  public void setV(String v) {
      this.v = v;
  }
  }
  
  @XmlAccessorType(XmlAccessType.NONE)
  @XmlRootElement(name = "Period")
  public class Period {
  
  @XmlElement(name = "TimeInterval")
  protected TimeInterval timeInterval;
  
  @XmlElement(name = "Pt")
  protected List&lt;Pt&gt; pt;
  
  public TimeInterval getTimeInterval() {
      return this.timeInterval;
  }
  
  public void setTimeInterval(TimeInterval timeInterval) {
      this.timeInterval = timeInterval;
  }
  
  public List&lt;Pt&gt; getPt() {
      if (this.pt == null) {
      this.pt = new ArrayList&lt;Pt&gt;();
      }
      return this.pt;
  }
  
  public void setPt(List&lt;Pt&gt; pt) {
      this.pt=pt;
  }
  
  }
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "TimeInterval")
  public class TimeInterval {
  
  @XmlAttribute(name = "v")
  private String timeIntervalPeriod;
  
  public String getTimeIntervalPeriod() {
      return this.timeIntervalPeriod;
  }
  
  public void setTimeIntervalPeriod(String timeIntervalPeriod) {
      this.timeIntervalPeriod = timeIntervalPeriod;
  }
  
  }
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "Pt")
  public class Pt {
  
  @XmlElement(name = "P")
  protected P p;
  
  @XmlElement(name = "A")
  protected A a;
  
  public P getP() {
      return this.p;
  }
  
  public void setP(P p) {
      this.p = p;
  }
  
  public A getA() {
      return this.a;
  }
  
  public void setA(A a) {
      this.a = a;
  }
  }
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "P")
  public class P {
  @XmlAttribute(name = "v")
  protected String position;
  
  
  public String getPosition(){
      return this.position;
  }
  
  public void setPosition(String position){
      this.position=position;
  }
  }
  
  @XmlAccessorType(XmlAccessType.FIELD)
  @XmlRootElement(name = "A")
  public class A {
  @XmlAttribute(name = "v")
  protected String calculatedAmount;
  
  public String getCalculatedAmount() {
      return this.calculatedAmount;
  }
  
  public void setCalculatedAmount(String calculatedAmount) {
      this.calculatedAmount = calculatedAmount;
  }
  }
  </code></pre>
  
  <p>when i try to read the xlm file i get
  i get</p>
  
  <pre><code>com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
  Class has two properties of the same name "timeSeries"
      this problem is related to the following location:
          at public java.util.List testjaxp.ModeleREP.getTimeSeries()
          at testjaxp.ModeleREP
      this problem is related to the following location:
          at protected java.util.List testjaxp.ModeleREP.timeSeries
          at testjaxp.ModeleREP
  </code></pre>
  
  <p>i don't understand this error</p>
  
  <p>edit: i use jaxb-impl-2.1.12</p>
  
  <p>ok now i don't have any error, but when i check my object, timeSeries is null...</p>
  
  <p>so maybe jaxb seem to have problem with flx?</p>