users@jersey.java.net

Re: [Jersey] Rid off the _at_at symbol on JSON responses?

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Mon, 14 Dec 2009 12:48:25 +0100

On Mon, Dec 14, 2009 at 10:56:07AM +0100, Felipe Gaucho wrote:
> I tried to modify my project based on your example but I couldn't find
> what was the trick ;)

I see, so ok: the "trick" is to add:

META-INF/services/javax.ws.rs.ext.MessageBodyReader
META-INF/services/javax.ws.rs.ext.MessageBodyWriter

both containing:
org.codehaus.jackson.jaxrs.JacksonJsonProvider

and you would also need to add:
http://repo1.maven.org/maven2/org/codehaus/jackson/jackson-jaxrs/1.1.1/jackson-jaxrs-1.1.1.jar
to your webapp WEB-INF/lib, as this jar is not included
in GlassFish, and needs to be pulled in by the application itself.

Does it help?

~Jakub


>
> On the evening I can prepare a sample project...
>
> On 14.12.2009, at 10:27, Jakub Podlesak <Jakub.Podlesak_at_Sun.COM> wrote:
>
> >
> >Hi Felipe,
> >
> >On Sun, Dec 13, 2009 at 03:09:48PM +0100, Felipe Gaścho wrote:
> >>Hi Podlesak,
> >>
> >>I tried your example.. but I couldn't make it work with Glassfish
> >>V3..
> >
> >the example is based on Grizzly container, and does not generate
> >a war archive, which you could deploy onto GlassFish. Have you tried
> >to
> >change this, and the updated project does not work with GlassFish?
> >If so, could you please send the zipped project to me?
> >I can then try to fix it for you and send back.
> >
> >~Jakub
> >
> >>
> >>the trick is just to add that META-INF/files.. or there is
> >>something else ?
> >>
> >>
> >>
> >>
> >>
> >>On Fri, Dec 11, 2009 at 9:59 PM, Tatu Saloranta
> >><tsaloranta_at_gmail.com> wrote:
> >>>On Fri, Dec 11, 2009 at 2:57 AM, Jakub Podlesak <Jakub.Podlesak_at_sun.com
> >>>> wrote:
> >>>>On Fri, Dec 11, 2009 at 11:45:37AM +0100, Paul Sandoz wrote:
> >>>>>
> >>>>>On Dec 11, 2009, at 12:32 AM, Tatu Saloranta wrote:
> >>>>>
> >>>>>>2009/12/10 Felipe Gaścho <fgaucho_at_gmail.com>:
> >>>>>>>thanks Brown,
> >>>>>>>
> >>>>>>>but if I need to add a new framework just to remove the @ then I
> >>>>>>>prefer to convert the attributes in elements.. then it is
> >>>>>>>solved........... no extra code needed.............
> >>>>>>
> >>>>>>No new framework. And library (jar) in question is already
> >>>>>>bundled by
> >>>>>>Jersey (although not 100% sure if jackson-jax-rs jar is).
> >>>>>
> >>>>>IIRC jackson-jax-rs is not currently included, Jakub can
> >>>>>confirm. But
> >>>>>jackson is (and distributed with GF v3!).
> >>>>
> >>>>Confirmed.
> >>>>
> >>>>~Jakub
> >>>
> >>>Great, that is good to know.
> >>>
> >>>-+ Tatu +-
> >>>
> >>>---
> >>>------------------------------------------------------------------
> >>>To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> >>>For additional commands, e-mail: users-help_at_jersey.dev.java.net
> >>>
> >>>
> >>
> >>
> >>
> >>--
> >>------------------------------------------
> >> Felipe Gaścho
> >> 10+ Java Programmer
> >> CEJUG Senior Advisor
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> >>For additional commands, e-mail: users-help_at_jersey.dev.java.net
> >>
> >
> >--
> >http://blogs.sun.com/japod
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> >For additional commands, e-mail: users-help_at_jersey.dev.java.net
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>

-- 
http://blogs.sun.com/japod