Hi
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>
Before I made the bean session-scoped everything was working fine but when I
made it session-scoped, I'm getting the following exception:
Application has thrown exception, unwinding now:
java.lang.IllegalArgumentException: setAttribute: Non-serializable attribute
I made xyzService class Serializable, and then accessing the service gives
an NPE
At the moment only the default singleton scope is supported by the JAX-RS runtime, with the support for a 'prototype' one being on
the map. I'm not sure yet what would need to be done for it to support all the Spring prototypes.
For ex, at the moment, the JAX-RS runtime can reuse the same beans across multiple requests, or create a new bean/resource class
instance per every request (with this latter feature being not currently supported with Spring involved - to be done, but only when
lifecycle policies are set programmatically). It all can be mapped quite easily to singleton/prototype scopes.
But I don't understand what would it take for scopes like 'session' be supported. I've briefly looked at the Spring docs : "Scopes a
single bean definition to the lifecycle of a HTTP Session. Only valid in the context of a web-aware Spring ApplicationContext."
Can such scopes be supported by the JAX-WS runtime ?
Cheers, Sergey
Any clues? I just need the xyzService bean to be session scoped
--
View this message in context:
http://www.nabble.com/Unable-to-get-results-from-JAX-RS-service-after-declaring-the-referred-bean-as-session-scoped-tp18611651p18611651.html
Sent from the cxf-user mailing list archive at Nabble.com.
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland