Class has two properties of the same name "elementList" this problem is related to the following location: at public java.util.List com.jaxb.tieba.JaxbList.getElementList() at com.jaxb.tieba.JaxbList this problem is related to the following location: at private java.util.List com.jaxb.tieba.JaxbList.elementList at com.jaxb.tieba.JaxbList
如果将注解加到 field 上面 将会报出一个如下异常
@XmlRootElementpublic class JaxbList<T> { @XmlElement(name="elments") private List<T> elementList = new ArrayList<T>();public List<T> getElementList() { return elementList; }}
再分享一下我老师大神的人工智能教程吧。零基础!通俗易懂!风趣幽默!还带黄段子!希望你也加入到我们人工智能的队伍中来!https://blog.csdn.net/jiangjunshow