users@jersey.java.net

Re: [Jersey] Problem with injected HttpServletRequest proxy

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 08 Dec 2009 14:23:40 +0100

On Dec 8, 2009, at 2:02 PM, Ian Carr wrote:

> Many thanks, work around should be fine.
>
> Snapshots, I thought that was the difference between the stable and
> dev repositories?


SNAPSHOT releases are delivered continuously to the maven repo.
Java.net does not have a difference between a SNAPSHOT and non-
SNAPSHOT repo, which goes against best practice, but unfortunately
that is the way things are currently set up.

We will release 1.1.5 in Jan.

Paul.

> Or will dev go when the release is out?
>
> -----Original Message-----
> From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
> Sent: 08 December 2009 12:47
> To: users_at_jersey.dev.java.net
> Subject: Re: [Jersey] Problem with injected HttpServletRequest proxy
>
> On Dec 8, 2009, at 1:36 PM, Ian Carr wrote:
>
>> Yep, good one, I had also left out the try catch in the handler I
>> wrote in my Filter, adding it in the behavior is as expected!
>>
>
> Great. I am currently testing a fix locally that i will commit later
> today.
>
>
>> I don't suppose that will make it into the GF release?, is there a
>> way I can use an alternate implementation of Jersey from WEB-INF/lib?
>
> You can use the workaround i previously indicated, namely do:
>
> @POST
> @Path("login")
> @Consumes( { MediaType.APPLICATION_JSON })
> public void loginUser(@Context ThreadLocal<HttpServletRequest> req,
> UIdent ident) {
> try {
> // does the login work?
> String uname = ident.getUname();
> String pword = ident.getPword();
> req.get().login(uname, pword);
> } catch (ServletException ex) {
> __log.info("Failed login attempt", ex);
> throw new WebApplicationException(Status.UNAUTHORIZED);
> }
> }
>
>
> This will not make it into GF until we release 1.1.5 and then it will
> be available using the update centre. I would like to make available
> SNAPSHOT releases in the update centre as well but currently we do not
> allow that, i am not sure why as there should not be any technical
> impediments to such a solution.
>
> If you do not want to utilize the workaround then in the interim you
> can use 1.1.5-ea-SNAPSHOT jars in the war, just make sure you have set
> the class loader delegation to false in the sun-web.xml. You might see
> a couple of exceptions occurring on deployment but it should not
> effect the running of the application (the problem is that GF,
> currently, cannot properly isolate web applications and Jersey's use
> of META-INF/services requires that).
>
> Paul.
>
> ---------------------------------------------------------------------
> 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
>