Hi Ian/Sergey,

Ultimately I had to do what Ian suggested. I was kind of avoiding that
because making the service bean session scoped would be neat. Here's the
deal. I had to do some pagination in my service bean and thats why I was
trying to make it session scoped(by adding aop:scoped-proxy tag) so that
pagination would work properly for different users. Yesterday I read
somewhere that Spring's resource injection may override Apache CXF's
resource injection sometimes, which I think was happening in my case. So
ultimately I placed the session-sensitive info (i.e. the object holding the
results being paginated, along with the pagination info) into the session. 
I did not use a separate class xyzSessionState to store the session state.
So this way having a singleton service bean did not cause any problem.
Although I wish I could somehow make the aop:scoped-proxy work with Spring
2.0 and Apache CXF.

Thanks everybody for your help.



Sergey Beryozkin wrote:
> 
> Can you explain please what is it exactly that you're trying to achieve
> with a JAX-RS root resource class by
> applying <aop:scoped-proxy/> to it ?
> And again, why what Ian suggested below is not working for you ?
> 
> You said you needed a reference to an HttpServletRequest in your resource
> class ? If yes, then you can get it using just JAX-RS 
> techniques...
> 
> Sorry, I just don't understand all these Spring black-art tricks, so
> please be patient :-)
> 
> Cheers, Sergey
> 
>>
>> Even then, I would need access to HttpServletRequest in xyzSessionState
>> which
>> is now an aop-scoped proxy bean and again resource injection would not
>> work,
>> isnt it?
>>
>>
>> ianroberts wrote:
>>>
>>> CFX Novice wrote:
>>>> Hi,
>>>>
>>>> I have this piece of code in my applicationContext.xml
>>>>
>>>>     <jaxrs:server id="xyzserver" address="/xyzservice/">
>>>>     <jaxrs:serviceBeans>
>>>>       <ref bean="xyzservice" />
>>>>     </jaxrs:serviceBeans>
>>>>   </jaxrs:server>
>>>>
>>>>   <bean id="xyzservice" class="com.xyz.xyzService" scope="session">
>>>>           <aop:scoped-proxy/>
>>>>   </bean>
> 
> ----------------------------
> IONA Technologies PLC (registered in Ireland)
> Registered Number: 171387
> Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Resource-injection-fails-for-an-AOP-scoped-proxy-bean-tp18631370p18645795.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to