counts of IllegalAnnotationExceptions @javax.xml.bind.annotation.XmlElement annotation is found on two places; one would be suffice.

So this happen when you annotate the filed this way

@XmlElement(name = "Country")
private String country;

Throws an Error as below

@javax.xml.bind.annotation.XmlElement annotation is found on two places; one would be suffice.
this problem is related to the following location:
at @javax.xml.bind.annotation.XmlElement(nillable=false, name=Country, defaultValue=


The easy fix is to move the annotation to the setter method

@XmlElement(name = "Country")
public void setCountry(String country) {
this.country = country;
}

This Works Fine.

Comments

Popular posts from this blog

'jasypt.encryptor.password' or one of ['jasypt.encryptor.privateKeyString', 'jasypt.encryptor.privateKeyLocation'] must be provided for Password-based or Asymmetric encryption

Field or property 'jobParameters' cannot be found on object of type 'org.springframework.beans.factory.config.BeanExpressionContext' - Spring Batch

Couldn't store job: Unable to serialize JobDataMap for insertion into database because the value of property 'jobLauncher' is not serializable