I'm using Jaxb-api
version 2.2.5
to convert an xml String to a java Object.
Here is my XML example:
<tag:TAG xmlns:tag="xxxxxxxx/tag" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="xxxxxxxx/tag RCARRVAL.xsd">
<tag:home>
<tag:home_001>01</tag:home_001>
<tag:home_002>0032</tag:home_002>
<tag:home_003>1977</tag:home_003>
<tag:home_004>4</tag:home_004>
<tag:home_005>4</tag:home_005>
<tag:home_010>2017-12-31</tag:home_010>
<tag:home_999>RG01</tag:home_999>
</tag:home>
</tag:TAG>
here is my object:
@XmlRootElement(name="tag:home")
@XmlAccessorType(XmlAccessType.FIELD)
public class Customer {
protected Date dateDebut;
@XmlElement(name="tag:home_003")
public Date getDateDebut() {
return dateDebut;
}
public void setDateDebut(Date dateDebut) {
this.dateDebut = dateDebut;
}
}
and here is my exceptions But this is not working i mfacing some issues / even when i put @XmlElement(name="tag:home_003") on gettter or on setter
com.sun.xml.internal.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
La classe comporte deux propriétés du même nom ("dateDebut")
this problem is related to the following location:
at public java.util.Date fr.models.Customer.getDateDebut()
at fr.models.Customer
this problem is related to the following location:
at protected java.util.Date fr.models.Customer.dateDebut
at fr.models.Customer