You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Witold Szczerba <pl...@gmail.com> on 2013/01/20 03:05:18 UTC

Configure CXF JAX-RS provider globally.

Hi,
how can I configure CXF, so it uses, for example, JacksonJsonProvider for
my entire application (or for any application on my server)?

I can see examples of per-endpoint config, but not for entire webapp or
server.

I am using TomEE 1.5.1 JAX-RS profile.

Regards,
Witold Szczerba

Re: Configure CXF JAX-RS provider globally.

Posted by Romain Manni-Bucau <rm...@gmail.com>.
you mean apply "automatically"?

well by default it is not on since it can lead to issues (it is easy today
to get several providers for the same media type). You need to add the
system property openejb.jaxrs.providers.auto=true to use it.

That said we often configure the provider so configuring it for the
application should be the best usage enough in real apps IMO.

*Romain Manni-Bucau*
*Twitter: @rmannibucau <https://twitter.com/rmannibucau>*
*Blog: **http://rmannibucau.wordpress.com/*<http://rmannibucau.wordpress.com/>
*LinkedIn: **http://fr.linkedin.com/in/rmannibucau*
*Github: https://github.com/rmannibucau*



2013/1/20 Witold Szczerba <pl...@gmail.com>

> Hi,
> I will keep maintaining the list of my JAXRS endpoints, one by one, in
> openejb-jar.xml, until TomEE 1.5.2 comes to the rescue :)
> Thanks!
>
> By the way: following the JAX-RS specification, it should be also possible
> to create a class annotated e.g.:
> @javax.ws.rs.ext.Provider
> @javax.ws.rs.Produces(MediaType.APPLICATION_JSON)
> public SomeProvider {...}
>
> and, at application startup, container should pick it and apply this
> configuration. I was using this on Glassfish 3.x. Is the TomEE 1.5.2 going
> to support that?
>
> Regards,
> Witold Szczerba
>
>
> On 20 January 2013 08:55, Romain Manni-Bucau <rm...@gmail.com>
> wrote:
>
> > Hi
> >
> > Was not possible with 1.5.1. It is with the current snapshot
> > 1.5.2-SNAPSHOT.
> >
> > Same config as for endpoint but class-name is either your app class or
> > "jaxrs-application" if no application class
> > Le 20 janv. 2013 03:05, "Witold Szczerba" <pl...@gmail.com> a
> écrit
> > :
> >
> > > Hi,
> > > how can I configure CXF, so it uses, for example, JacksonJsonProvider
> for
> > > my entire application (or for any application on my server)?
> > >
> > > I can see examples of per-endpoint config, but not for entire webapp or
> > > server.
> > >
> > > I am using TomEE 1.5.1 JAX-RS profile.
> > >
> > > Regards,
> > > Witold Szczerba
> > >
> >
>

Re: Configure CXF JAX-RS provider globally.

Posted by Witold Szczerba <pl...@gmail.com>.
Hi,
I will keep maintaining the list of my JAXRS endpoints, one by one, in
openejb-jar.xml, until TomEE 1.5.2 comes to the rescue :)
Thanks!

By the way: following the JAX-RS specification, it should be also possible
to create a class annotated e.g.:
@javax.ws.rs.ext.Provider
@javax.ws.rs.Produces(MediaType.APPLICATION_JSON)
public SomeProvider {...}

and, at application startup, container should pick it and apply this
configuration. I was using this on Glassfish 3.x. Is the TomEE 1.5.2 going
to support that?

Regards,
Witold Szczerba


On 20 January 2013 08:55, Romain Manni-Bucau <rm...@gmail.com> wrote:

> Hi
>
> Was not possible with 1.5.1. It is with the current snapshot
> 1.5.2-SNAPSHOT.
>
> Same config as for endpoint but class-name is either your app class or
> "jaxrs-application" if no application class
> Le 20 janv. 2013 03:05, "Witold Szczerba" <pl...@gmail.com> a écrit
> :
>
> > Hi,
> > how can I configure CXF, so it uses, for example, JacksonJsonProvider for
> > my entire application (or for any application on my server)?
> >
> > I can see examples of per-endpoint config, but not for entire webapp or
> > server.
> >
> > I am using TomEE 1.5.1 JAX-RS profile.
> >
> > Regards,
> > Witold Szczerba
> >
>

Re: Configure CXF JAX-RS provider globally.

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

Was not possible with 1.5.1. It is with the current snapshot 1.5.2-SNAPSHOT.

Same config as for endpoint but class-name is either your app class or
"jaxrs-application" if no application class
Le 20 janv. 2013 03:05, "Witold Szczerba" <pl...@gmail.com> a écrit :

> Hi,
> how can I configure CXF, so it uses, for example, JacksonJsonProvider for
> my entire application (or for any application on my server)?
>
> I can see examples of per-endpoint config, but not for entire webapp or
> server.
>
> I am using TomEE 1.5.1 JAX-RS profile.
>
> Regards,
> Witold Szczerba
>