You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by sgjava <sg...@gmail.com> on 2015/12/11 02:24:13 UTC
JAX-RS not marshalling List inside DTO
I have a basic DTO:
public class Dto {
private static final long serialVersionUID = 5968579769505097685L;
private Type1 var1;
private Type2 var2;
private List<StbData> list;
}
My ContainerResponseFilter displays the list in the log using:
log.debug(String.format("Entity: %s", responseContext.getEntity()));
However, the client returns list as null in the response. It appears to be
the client, but I'll need to do a test with wget to verify. I'm using the
following for JAX-RS provider:
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>org.jvnet.jaxb2_commons</groupId>
<artifactId>jaxb2-basics-runtime</artifactId>
<version>0.9.4</version>
</dependency>
And for test:
<dependency>
<groupId>org.apache.tomee</groupId>
<artifactId>tomee-jaxrs</artifactId>
<version>${tomee.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.13</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.13</version>
<scope>test</scope>
</dependency>
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JAX-RS-not-marshalling-List-inside-DTO-tp4677201.html
Sent from the TomEE Users mailing list archive at Nabble.com.
Re: JAX-RS not marshalling nested list
Posted by sgjava <sg...@gmail.com>.
Answering my own question:
ClientBuilder.newClient().register(JacksonJaxbJsonProvider.class);
--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/JAX-RS-not-marshalling-nested-list-tp4677201p4677206.html
Sent from the TomEE Users mailing list archive at Nabble.com.