You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by qmacpit <qm...@gmail.com> on 2012/09/19 09:33:38 UTC

TomEE+ Jackson: ignored annotations

Hi guys,

I've got TomEE+ with Jackon set up as JAX-RS JSON provider. I set it up like
this:
openejb.cxf.jax-rs.providers =
org.codehaus.jackson.jaxrs.JacksonJsonProvider
and put Jackson jars to Tomee lib folder

Serialization works fine except cases where I try to use Jackson
annotations. I ended up with using the simplest cases like @JsonIgnore or
@JsonProperty just to see if they work properly. So I have a very simple
entity bean with simple Jackson annotations that I try to serialize. The
REST response is not affected by annotations at all. I tried the same
implementation on JBoss & RESTEasy and it works as expected.

The only thing I managed to have working fine on TomEE is Jaxb
annotations(like @XmlTransient).

Is it a configuration issue? Do I need to set up something else in order to
have it running?
Anyone have it working in Tomee+??? Any feedback much appreciated

Cheers, 
qmacpit




--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-Jackson-ignored-annotations-tp4657511.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: TomEE+ Jackson: ignored annotations

Posted by Luca Merolla <lu...@gmail.com>.
Hi,

in the latest snapshots I have managed to use Jackson by adding
resources.xml and openejb-jar.xml in WEB-INF.

resources.xml looks like that:

<resources>
  <Service id="jsonProvider"
class-name="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
  <Service id="jaxbProvider"
class-name="org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider" />
</resources>

And openejb-jar looks like that:

<openejb-jar xmlns="http://www.openejb.org/openejb-jar/1.1">
<pojo-deployment class-name="org.my.rest.ResourceImpl">
<properties>
cxf.jaxrs.providers = jsonProvider, jaxbProvider
</properties>
</pojo-deployment>
</openejb-jar>

On Wed, Sep 19, 2012 at 9:37 AM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> Hi,
>
> which version? the snapshot should handle it properly bu the configuration
> changed (it was too complicated to use syst prop for real apps)
>
> you need to add in your bean properties in openejb-jar.xml the property
> cxf.jaxrs.providers=jsonJackson
>
> and match the value (you can put several comma separated) in resources.xml
>
> <Resource id="jsonJackson" class-name="..." />
>
> *Romain Manni-Bucau*
> *Twitter: @rmannibucau*
> *Blog: http://rmannibucau.wordpress.com*
>
>
>
>
> 2012/9/19 qmacpit <qm...@gmail.com>
>
> > Hi guys,
> >
> > I've got TomEE+ with Jackon set up as JAX-RS JSON provider. I set it up
> > like
> > this:
> > openejb.cxf.jax-rs.providers =
> > org.codehaus.jackson.jaxrs.JacksonJsonProvider
> > and put Jackson jars to Tomee lib folder
> >
> > Serialization works fine except cases where I try to use Jackson
> > annotations. I ended up with using the simplest cases like @JsonIgnore or
> > @JsonProperty just to see if they work properly. So I have a very simple
> > entity bean with simple Jackson annotations that I try to serialize. The
> > REST response is not affected by annotations at all. I tried the same
> > implementation on JBoss & RESTEasy and it works as expected.
> >
> > The only thing I managed to have working fine on TomEE is Jaxb
> > annotations(like @XmlTransient).
> >
> > Is it a configuration issue? Do I need to set up something else in order
> to
> > have it running?
> > Anyone have it working in Tomee+??? Any feedback much appreciated
> >
> > Cheers,
> > qmacpit
> >
> >
> >
> >
> > --
> > View this message in context:
> >
> http://openejb.979440.n4.nabble.com/TomEE-Jackson-ignored-annotations-tp4657511.html
> > Sent from the OpenEJB User mailing list archive at Nabble.com.
> >
>

Re: TomEE+ Jackson: ignored annotations

Posted by qmacpit <qm...@gmail.com>.
Hi,

Thanks for a fast reply. This is what I call SUPPORT:]

I'm using a standard 1.0 release version.
It's great it's going to work in the snapshot. I'm going to give it a try
with this one:
apache-tomee-1.1.1-20120918.041024-1-plus

I hope I'll get through the configuration stuff quickly and have it
up&running soon.

Thanks a lot,
qmacpit

 



--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-Jackson-ignored-annotations-tp4657511p4657518.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: TomEE+ Jackson: ignored annotations

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

which version? the snapshot should handle it properly bu the configuration
changed (it was too complicated to use syst prop for real apps)

you need to add in your bean properties in openejb-jar.xml the property
cxf.jaxrs.providers=jsonJackson

and match the value (you can put several comma separated) in resources.xml

<Resource id="jsonJackson" class-name="..." />

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/9/19 qmacpit <qm...@gmail.com>

> Hi guys,
>
> I've got TomEE+ with Jackon set up as JAX-RS JSON provider. I set it up
> like
> this:
> openejb.cxf.jax-rs.providers =
> org.codehaus.jackson.jaxrs.JacksonJsonProvider
> and put Jackson jars to Tomee lib folder
>
> Serialization works fine except cases where I try to use Jackson
> annotations. I ended up with using the simplest cases like @JsonIgnore or
> @JsonProperty just to see if they work properly. So I have a very simple
> entity bean with simple Jackson annotations that I try to serialize. The
> REST response is not affected by annotations at all. I tried the same
> implementation on JBoss & RESTEasy and it works as expected.
>
> The only thing I managed to have working fine on TomEE is Jaxb
> annotations(like @XmlTransient).
>
> Is it a configuration issue? Do I need to set up something else in order to
> have it running?
> Anyone have it working in Tomee+??? Any feedback much appreciated
>
> Cheers,
> qmacpit
>
>
>
>
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/TomEE-Jackson-ignored-annotations-tp4657511.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>