well this has been posted a lot of time here but no solution worked for me...
i can avoid this error by making a wrapper class but it only returned
You should add at least a getter in your StringWrapper. Without public attributes, there is nothing to serialize. So the output is correct. If you do not want a tag around the list of your strings, you can mark a single getter with @XmlValue.
@XmlRootElement
public class StringWrapper {
public StringWrapper (){}
List<String> list=new ArrayList<String>();
public void add(String s) { list.add(s); }
@XmlValue
public List<String> getData() { return list; }
}