One quick suggestion I have is that you might want to see if a different
provider solves your problem. Generally, this means adding the right
.jar(s) to your application and specifying the provider to use in your
openejb-jar.xml file:
Jackson:
<openejb-jar>
<pojo-deployment
class-name="org.superbiz.moviefun.rest.ApplicationConfig">
<properties>
cxf.jaxrs.providers =
org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider
</properties>
</pojo-deployment>
</openejb-jar>
<!-- Dependencies for Jackson CXF provider -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-jaxrs</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.13</version>
</dependency>
Or Johnzon:
<openejb-jar>
<pojo-deployment
class-name="org.superbiz.moviefun.rest.ApplicationConfig">
<properties>
cxf.jaxrs.skip-provider-scanning = true
cxf.jaxrs.providers =
org.apache.johnzon.jaxrs.JohnzonProvider,org.apache.openejb.server.cxf.rs.EJBAccessExceptionMapper
</properties>
</pojo-deployment>
</openejb-jar>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-core</artifactId>
<version>0.5-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-mapper</artifactId>
<version>0.5-incubating</version>
</dependency>
<dependency>
<groupId>org.apache.johnzon</groupId>
<artifactId>johnzon-jaxrs</artifactId>
<version>0.5-incubating</version>
</dependency>
I would imagine you will still need to do some fiddling to get the exact
output you require, but one of these providers may help if you're not
getting the exact output you want from the CXF provider.
Hope that helps.
Jon
On Tue, Mar 24, 2015 at 1:11 PM, bibhas <[email protected]> wrote:
> Jean-Louis MONTEIRO wrote
> > I guess you use this definition as a reference in this openejb-jar.xml ?
>
> Hi jean, I am not sure I understand your question. I am using
> openejb-jar.xml and resource.xml already to fix many other strange
> behaviors
> of JSONProvider. Now I am trying to fix this particular problem where a
> single element array is not serialized as array.
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/JSONProvider-single-length-array-tp4674152p4674159.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>