tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Romain Manni-Bucau <rmannibu...@gmail.com>
Subject Re: serializeAsArray JacksonJaxbJsonProvider
Date Mon, 20 Oct 2014 13:38:36 GMT
<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://www.openejb.org/openejb-jar/1.1 ">
    <pojo-deployment  class-name="jaxrs-application">
         <properties>
            cxf.jaxrs.providers = json
        </properties>
    </pojo-deployment>
</openejb-jar>


resources.xml

<resources>
    <Service id="json"
class-name="org.apache.cxf.jaxrs.provider.json.JSONProvider">
        serializeAsArray = true
    </Service>
</resources>


jackson doesn't have any setter so you have to do your own wrapper to
provide the properties you want to configure (or hardcode them)




Romain Manni-Bucau
@rmannibucau
http://www.tomitribe.com
http://rmannibucau.wordpress.com
https://github.com/rmannibucau


2014-10-20 15:34 GMT+02:00 José Luis Cetina <maxtorzito@gmail.com>:
> I changed to:
>
> <openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>              xsi:schemaLocation="http://www.openejb.org/openejb-jar/1.1 ">
>     <pojo-deployment  class-name="jaxrs-application">
>          <properties>
>             cxf.jaxrs.providers =
> com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider
>         </properties>
>     </pojo-deployment>
> </openejb-jar>
>
>
> resources.xml
>
> <resources>
>     <Service id="json"
> class-name="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider">
>         serializeAsArray = true
>     </Service>
> </resources>
>
>
> and didnt work, what is the value of id in service tag? is json correct? do
> i have to set the same class name in both files?? i really dont understand
> this config.
>
> 2014-10-19 2:24 GMT-05:00 Romain Manni-Bucau <rmannibucau@gmail.com>:
>
>> If you have a custom jaxrs application class-name should be its name.
>>
>> And once you use resources, providers values should be their ids (json
>> here) in openejb-jar.
>>  Hi,
>> I usually add my own @provider / "extends JacksonJaxbJsonProvider")
>>
>> and set all my needed objectmapper options there.
>>
>> br hw
>>
>>
>>
>> --
>> View this message in context:
>>
>> http://tomee-openejb.979440.n4.nabble.com/serializeAsArray-JacksonJaxbJsonProvider-tp4672427p4672431.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> -------------------------------------------------------------------
> *José Luis Cetina*
> -------------------------------------------------------------------

Mime
View raw message