Я хочу создать объект JAXB, используя следующий код:
@XmlRootElement(name = "payment_transaction")
@XmlAccessorType(XmlAccessType.FIELD)
public class AuthorizeRequest {
@XmlElement(name = "transaction_type")
public String transaction_type;
@XmlElement(name = "transaction_id")
public String transaction_id;
.......
public String getTransaction_type() {
return transaction_type;
}
public void setTransaction_type(String transaction_type) {
this.transaction_type = transaction_type;
}
public String getTransaction_id() {
return transaction_id;
}
}
Внутренний объект:
public class Address {
@XmlElement(name = "first_name")
public String firstName;
@XmlElement(name = "last_name")
public String lastName;
... getters and setters
}
Но я получаю ошибку:
2019-06-23 11:43:10,495 ERROR [stderr] (AuthorizeContainer-1) Class has two properties of the same name "address1"
2019-06-23 11:43:10,496 ERROR [stderr] (AuthorizeContainer-1) this problem is related to the following location:
2019-06-23 11:43:10,496 ERROR [stderr] (AuthorizeContainer-1) at public java.lang.String authorize.request.Address.getAddress1()
2019-06-23 11:43:10,496 ERROR [stderr] (AuthorizeContainer-1) at authorize.request.Address
2019-06-23 11:43:10,496 ERROR [stderr] (AuthorizeContainer-1) at public request.Address AuthorizeRequest.billingAddress
DoВы знаете, как я могу решить эту проблему?Нужно ли добавлять аннотации для класса Address?