users@jersey.java.net

Re: [Jersey] confusing exception

From: Jakub Podlesak <Jakub.Podlesak_at_Sun.COM>
Date: Thu, 24 Sep 2009 17:35:21 +0200

On Wed, Sep 23, 2009 at 11:48:03PM +0200, Jordi Domingo wrote:
>
> Hi Jakub !
> Do you have any news about this? I'm reaching the deadline and i need to solve this. I think that i will use Xtream if we cant get this to work.

Hi Jordi, nothing new so far. It seems like a strange classloading issue in GlassFish v3.
Need some more time to narrow down a simple test case to provide to GlassFish guys, so that
they could help me out.

Thanks for your patience,

~Jakub


> Thanks!
> Jordi
>
> > Date: Thu, 17 Sep 2009 13:42:38 +0200
> > From: Jakub.Podlesak_at_Sun.COM
> > To: users_at_jersey.dev.java.net
> > Subject: Re: [Jersey] confusing exception
> >
> > On Thu, Sep 17, 2009 at 12:53:07PM +0200, Jordi Domingo wrote:
> > >
> > > Thanks for your reply Jakub.
> > > I updated GFv3, all available modules. I even copied http://download.java.net/maven/2/com/sun/xml/bind/jaxb-osgi/2.2-promoted-b53/jaxb-osgi-2.2-promoted-b53.jar to the glassfish/modules folder
> >
> > Hi Jordi,
> >
> > There is a confusion here, as i was referring to GlassFish *v2.1*,
> > still need to find out, why things do not work on GF *v3* with the provided jaxb.
> >
> > Please stay tuned,
> >
> > ~Jakub
> >
> > > The error is there. Dont know what im doing wrong..
> > > Jordi
> > > > Date: Thu, 17 Sep 2009 10:28:37 +0200
> > > > From: Jakub.Podlesak_at_Sun.COM
> > > > To: users_at_jersey.dev.java.net
> > > > Subject: Re: [Jersey] confusing exception
> > > >
> > > > On Wed, Sep 16, 2009 at 12:56:59PM +0200, Jordi Domingo wrote:
> > > > >
> > > > > Thanks Jakub,
> > > > > I have started using GF recently, which bundles should be updated (i updated jersey bundles) and where can i download them?
> > > >
> > > > Jersey modules could be updated via standard GlassFish Update Center client.
> > > > Just launch $AS_HOME/updatecenter/bin/updatetool
> > > >
> > > > If you want to bundle the right jar files with your war, the best would be
> > > > to look at [1] for more information on various dependencies and where
> > > > to download them from.
> > > >
> > > > ~Jakub
> > > >
> > > > [1]https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.1.2-ea/jersey/dependencies.html
> > > >
> > > >
> > > > > Thanks!
> > > > > Jordi
> > > > >
> > > > > > Date: Wed, 16 Sep 2009 11:14:55 +0200
> > > > > > From: Jakub.Podlesak_at_Sun.COM
> > > > > > To: users_at_jersey.dev.java.net
> > > > > > Subject: Re: [Jersey] confusing exception
> > > > > >
> > > > > > On Mon, Sep 14, 2009 at 11:09:34AM -0600, Turner, George wrote:
> > > > > > > I am going to backtrack just a little. Only ONE of our browser based calls gets the exception. All other browser based calls perform natural translation without error. We cannot determine why they are different at this point.
> > > > > >
> > > > > > It is really strange, that different behaviour would be caused by using different browsers.
> > > > > > Have you tried if the natural notation is indeed used? e.g. single element arrays
> > > > > > delimited with [] and numbers serialized out as numbers and not a strings?
> > > > > > The exception could be thrown only once, but i am curious, if the natural notation
> > > > > > is ever effectively used.
> > > > > >
> > > > > > I have just tested with the project provided by Jordi, and to make the natural notation
> > > > > > work properly on GlassFish v2.1 i needed to bundle not only JAXB jars, but also Jersey jars
> > > > > > with the application war file, and set delegation to false at the sun-web.xml
> > > > > > descriptor. Attaching the zipped project.
> > > > > > (You need to build the war with "mvn -Pbundle-jars package")
> > > > > >
> > > > > > I am afraid, for GFv2.1, until JAXB impl bundled with metro is upgraded, this is the only
> > > > > > workaround to enable the natural notation.
> > > > > >
> > > > > > ~Jakub
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > Gene
> > > > > > >
> > > > > > > From: Jordi Domingo [mailto:noseya_at_hotmail.com]
> > > > > > > Sent: Monday, September 14, 2009 10:55
> > > > > > > To: users_at_jersey.dev.java.net
> > > > > > > Subject: RE: [Jersey] confusing exception
> > > > > > >
> > > > > > >
> > > > > > > Hi George,
> > > > > > >
> > > > > > > In my case the exception is thrown when deploying the application and JSONJaxbContext gets loaded.
> > > > > > >
> > > > > > > Jordi
> > > > > > >
> > > > > > > > Date: Mon, 14 Sep 2009 10:45:59 -0600
> > > > > > > > From: george.turner_at_lmco.com
> > > > > > > > To: users_at_jersey.dev.java.net
> > > > > > > > Subject: RE: [Jersey] confusing exception
> > > > > > > >
> > > > > > > > I have taken the JAXB2.2 jars (all of the api jars) and copied them into both the JDK6/lib/endorsed and the glassfish lib/endorsed (even though this duplicates the classes bundled by Metro in the webservices-api.jar that is ALSO in lib/endorsed) and the exception does not go away. It would help a lot to troubleshoot this if we could figure out what is going on and a better explanation of the exception. As it occurs whatever we do but still works, we cannot determine the cause.
> > > > > > > >
> > > > > > > > Also, we have SEVERAL services all using the natural notation, called from GWT/Javascript clients and there is never an exception thrown, BUT, the exception is thrown EVERY time when called by a Jersey client. This means that there is something be set or not set by the Jersey client to induce the exception that DOES NOT OCCUR when the client is a browser, either IE or Firefox.
> > > > > > > >
> > > > > > > > Thanks
> > > > > > > >
> > > > > > > > Gene
> > > > > > > >
> > > > > > > > -----Original Message-----
> > > > > > > > From: Jakub.Podlesak_at_Sun.COM [mailto:Jakub.Podlesak_at_Sun.COM]
> > > > > > > > Sent: Monday, September 14, 2009 02:43
> > > > > > > > To: users_at_jersey.dev.java.net
> > > > > > > > Subject: Re: [Jersey] confusing exception
> > > > > > > >
> > > > > > > > On Mon, Sep 14, 2009 at 10:01:06AM +0200, Jakub Podlesak wrote:
> > > > > > > > > On Fri, Sep 11, 2009 at 07:48:34AM -0600, Turner, George wrote:
> > > > > > > > > > I am already working another test case for a memory leak in Metro, so this one will have to wait.
> > > > > > > > >
> > > > > > > > > O.K.
> > > > > > > > >
> > > > > > > > > > For the moment though, I would like to confirm some versioning here.
> > > > > > > > > >
> > > > > > > > > > I am using Glassfish V2.1 with Metro 2.0 and Jdk6u16. The version of Jaxb that is packaged with Metro should be recent enough for the Jersey 1.1.2, or am I mistaken?
> > > > > > > >
> > > > > > > > So Metro in GlassFish v2.1 is bundling JAXB v2.1.6, which is not sufficient for Jersey, namely when you want to use the natural JSON notation.
> > > > > > > >
> > > > > > > > You would need to bundle JAXB v2.1.12 jars with your application war archive to make the natural thing work with GFv2.1. I was told, JAXB bundled with Metro will be upgraded when Metro 2.0 is released. This should happen together with GFv3 release sometime on November.
> > > > > > > >
> > > > > > > > ~Jakub
> > > > > > > >
> > > > > > > > >
> > > > > > > > > Is the jaxb-api jar placed in the lib/endorsed subdirectory of your GFv2 domain?
> > > > > > > > > I need to check with metro guys the JAXB version, but generally since
> > > > > > > > > JDK6 bundles JAXB, you need to use endorsed mechanism here to pick up the right jars.
> > > > > > > > >
> > > > > > > > > ~Jakub
> > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Thanks
> > > > > > > > > >
> > > > > > > > > > Gene
> > > > > > > > > >
> > > > > > > > > > -----Original Message-----
> > > > > > > > > > From: Jakub.Podlesak_at_Sun.COM [mailto:Jakub.Podlesak_at_Sun.COM]
> > > > > > > > > > Sent: Friday, September 11, 2009 00:59
> > > > > > > > > > To: users_at_jersey.dev.java.net
> > > > > > > > > > Subject: Re: [Jersey] confusing exception
> > > > > > > > > >
> > > > > > > > > > On Fri, Sep 11, 2009 at 03:50:26AM +0200, Jordi Domingo wrote:
> > > > > > > > > > >
> > > > > > > > > > > I was going to ask the same question.I'm using natural notation, JDK6u12 (i tried jdk6u16 a few mins ago) and Glassfish v3 b62.
> > > > > > > > > > > I tried adding Jaxb 2.1.11 in my project and setting <class-loader
> > > > > > > > > > > delegate="false"/> but this generates another exception (even if
> > > > > > > > > > > this works its a very ugly solution..)
> > > > > > > > > >
> > > > > > > > > > The version 2.1.12 (2.1.11 is not sufficient) of JAXB is needed when using natural notation in Jersey. If you installed Jersey via GFv3 update-center client, this should work out of the box without a need to bundle anything with your application war file.
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > Can you please log an issue with your project attached as a reproducible test case?
> > > > > > > > > > If you do not want to make it public, please e-mail directly to me.
> > > > > > > > > >
> > > > > > > > > > Another issue is, that the error message should be properly localized, i.e. still in English, but more verbose and informative in this case. It seems [1] is back again.
> > > > > > > > > > Will try to check out once i get your test case.
> > > > > > > > > >
> > > > > > > > > > Thanks,
> > > > > > > > > >
> > > > > > > > > > ~Jakub
> > > > > > > > > >
> > > > > > > > > > [1]https://jersey.dev.java.net/issues/show_bug.cgi?id=276
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > > Thanks for your help.
> > > > > > > > > > > Jordi
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > > > _________________________________________________________________
> > > > > > > > > > > Messenger cumple 10 años ¡Descárgate ya los nuevos emoticonos!
> > > > > > > > > > > http://www.vivelive.com/felicidades
> > > > > > > > > >
> > > > > > > > > > --
> > > > > > > > > > Jakub Podlešák, Software Engineer
> > > > > > > > > > Web Services and Technologies, SUN Microsystems
> > > > > > > > > > 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
> > > > > > > > > >
> > > > > > > > >
> > > > > > > > > --
> > > > > > > > > Jakub Podlešák, Software Engineer
> > > > > > > > > Web Services and Technologies, SUN Microsystems
> > > > > > > > > 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
> > > > > > > > >
> > > > > > > >
> > > > > > > > --
> > > > > > > > Jakub Podlešák, Software Engineer
> > > > > > > > Web Services and Technologies, SUN Microsystems
> > > > > > > > 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
> > > > > > > >
> > > > > > >
> > > > > > > ________________________________
> > > > > > > Messenger cumple 10 años ¡Descárgate ya los nuevos emoticonos!<http://www.vivelive.com/felicidades>
> > > > > >
> > > > > > --
> > > > > > Jakub Podlešák, Software Engineer
> > > > > > Web Services and Technologies, SUN Microsystems
> > > > > > http://blogs.sun.com/japod
> > > > >
> > > > > _________________________________________________________________
> > > > > Con Vodafone disfruta de Hotmail gratis en tu móvil. ¡Pruébalo!
> > > > > http://serviciosmoviles.es.msn.com/hotmail/vodafone.aspx
> > > >
> > > > --
> > > > Jakub Podlešák, Software Engineer
> > > > Web Services and Technologies, SUN Microsystems
> > > > 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
> > > >
> > >
> > > _________________________________________________________________
> > > Con Vodafone disfruta de Hotmail gratis en tu móvil. ¡Pruébalo!
> > > http://serviciosmoviles.es.msn.com/hotmail/vodafone.aspx
> >
> > --
> > Jakub Podlešák, Software Engineer
> > Web Services and Technologies, SUN Microsystems
> > 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
> >
>
> _________________________________________________________________
> Descubre todas las formas en que puedes estar en contacto con amigos y familiares.
> http://www.microsoft.com/windows/windowslive/default.aspx

-- 
Jakub Podlešák, Software Engineer                                                             
Web Services and Technologies, SUN Microsystems                                               
http://blogs.sun.com/japod