我从xsd获得了以下生成的类。当我尝试发布到服务时,我收到以下错误。原因是没有生成的setter,在代码部分的注释中提供了原因。什么是解决方法?我显然不想把它设定为可忽略的。
org.codehaus.jackson.map.exc.UnrecognizedPropertyException: 无法识别的字段“标记”(类 com.rat.service.api.schema.ArrayOfToken),未标记为可忽略
@XmlRootElement(name = "ArrayOfToken")
public class ArrayOfToken
implements Serializable
{
private final static long serialVersionUID = 1L;
@XmlElement(name = "Token", required = true)
protected List<Token> token;
/**
* Gets the value of the token property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
* This is why there is not a <CODE>set</CODE> method for the token property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getToken().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Token }
*
*
*/
public List<Token> getToken() {
if (token == null) {
token = new ArrayList<Token>();
}
return this.token;
}