1. JAXB's default is to use public fields and public properties
(get/set methods). So, unless you use @XmlAccessorType to switch to
FIELD access, you'll need to annotate your get/set methods with
@XmlTransient.
2. Similar problem to #1. By annotating a private field that also has
public get/set methods, you've told JAXB about two properties that are
really the same. Use @XmlAccessorType(XmlAccessType.FIELD) if you
prefer to annotate your private fields.
On 11/17/06, s.michea_at_diviosoft.com <s.michea_at_diviosoft.com> wrote:
>
> Hi,
>
> I have a strange problem: i'm using Jaxb2.0.4 to create XML representation
> of EJB3 on jboss (developped in NB5.5)
> 1) the @XmlTransient annotations are ignored (they have no effect). I don't
> if this might help, but the fields also have a @Column annotation
> 2) sometimes, when I try to set explicitly the xml name of an element, I get
> a "Class has two properties of the same name" exception. (all my fields are
> private)
>
> Any idea ?
>
> Thank you.
> Sebastien Michea