Monday, October 19, 2009

CXF JAX-RS IllegalAnnotationException - Class has two properties of the same name

I am currently using Apache CXF to provide RESTful web services for the Australian PhenomeBank.

I was attempting to assign annotations of private field members of a class as follows:

    private Set<MutationType> mutationTypes  = EnumSet.noneOf(MutationType.class);

What I had forgot to do was assign the XmlAccessorType as follows:

public class SearchCriteria


  1. It works for me too. Just add @XmlAccessorType(XmlAccessType.FIELD)
    to my class.

  2. Nice post. But why is this needed?