Duplicated field in generated XML using JAXB

前端 未结 2 1077
遇见更好的自我
遇见更好的自我 2021-02-20 13:49

This is my scenario. I have a generic class:

public class Tuple extends ArrayList {
  //...
  public Tuple(T ...members) {
    this(Arrays.asLi         


        
2条回答
  •  旧时难觅i
    2021-02-20 14:32

    This might be quite old, but its the first result while searching for "JAXB duplicate fields"

    Stumbled upon the same problem, this did the trick for me:

    @XmlRootElement
    @XmlAccessorType(XmlAccessType.NONE) // <-- made the difference
    public abstract class ParentClass
    {
    ...
    }
    
    
    @XmlRootElement
    public class ChildClass extends ParentClass
    {
     ...
    }
    

提交回复
热议问题