Hi Clint

On Tue, Aug 2, 2011 at 7:53 PM, Clint Dovholuk <[email protected]> wrote:
> Sadly we are currently constrained to using 2.2.12 currently.  Would this 
> have been fixed between 2.2.12 and 2.4.1 or should it have worked in 2.2.12 
> as well?
>
It was fixed for 2.4.1 only based on the feedback from one of the
users. I'm not sure but may be you can get MessageContext injected
from Spring AOP handlers somehow in 2.2.12 ? If it's possible in
Spring AOP to set some properties on a given bean before the
invocation, then it might be an option.
CXF PhaseIntercepterChain.getCurrentMessage() will give the current
Message  and it can be used to initialize MessageContext instance as
'new MessageContextImpl(message)'. I can provide more info if you
decide to experiment with this option

Thanks, Sergey

> Thanks for your reply,
> -Clint
>
> Sent from my Dell Precision T1500
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:[email protected]]
> Sent: Tuesday, August 02, 2011 2:30 PM
> To: [email protected]
> Subject: Re: Context injection when using "request scoped" beans
>
> Hi
>
> On Tue, Aug 2, 2011 at 3:35 PM, Clint Dovholuk <[email protected]> wrote:
>> Hi all,
>>
>> I have followed the instructions at 
>> http://cxf.apache.org/docs/jaxrs-services-configuration.html to configure my 
>> jax-rs service as request scoped, created the simple custom factory as 
>> described but the @Context (org.apache.cxf.jaxrs.ext.MessageContext) does 
>> not seem to be getting set when I switched from singleton to request scope 
>> even though I followed the documentation which said to use serviceFactories 
>> because this is a known issue. (in the paragraph beginning with: "The 
>> request-scoped service bean instances [...] are not actually available at 
>> the initialization time thus one limitation of the above configuration is 
>> that it is not possible to inject JAX-RS contexts into these service beans")
>>
>> What might I be doing wrong? Any guidance is greatly appreciated. I could 
>> provide sample config files / classes if that'd help?
>>
> Which CXF version are you using ? That should work for 2.4.1. Some
> users have reported that the injection works for request-scope
> singletons...
> Cheers, Sergey
>
>> Thanks,
>> -Clint
>>
>>
>>
>>
>
>
>
> --
> Sergey Beryozkin
>
> http://sberyozkin.blogspot.com
> Talend - http://www.talend.com
>



-- 
Sergey Beryozkin

http://sberyozkin.blogspot.com
Talend - http://www.talend.com

Reply via email to