cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Kramer (JIRA)" <>
Subject [jira] Created: (CXF-3341) Bad JSON marshalling of List<String> object
Date Wed, 16 Feb 2011 11:06:57 GMT
Bad JSON marshalling of List<String> object

                 Key: CXF-3341
             Project: CXF
          Issue Type: Bug
          Components: JAX-RS
    Affects Versions: 2.3.2
         Environment: Ubuntu 10.04 64Bit Server
            Reporter: Ilya Kramer

Wrong result returned by marshalling an object with List<String>. The result some why
depends on the actual amount of elements on the list.

for example , this code

package ldtv.api.models;

import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "user")
public class LDTVSites {
	private List<String> sites;

	public LDTVSites(List<String> sites) {



	public LDTVSites() {

	public void setSites(List<String> listSites) {
		this.sites = listSites;
	public List<String> getSites(){
		return sites;


if getSites returns a list with single result, the result of the function will be

whereas if the result is two strings in the list , the output will be

this makes some sense in XML , it shouldn't be so in JSON since the values of the two expressions
is different

This message is automatically generated by JIRA.
For more information on JIRA, see:


View raw message