Hi - it has to be a setter and you need to have a dedicated interface
with methods like
setMessageContext which the root resource will implement, that should help

Cheers, Sergey

On Fri, May 13, 2011 at 11:01 AM, Shashank Rachamalla
<[email protected]> wrote:
> Hi
>
> I have been trying to get a reference to MessageContext through @Context
> annotation. However, when spring AOP is enabled I see the following
> exception being thrown. any clues ?
>
> Caused by: java.lang.IllegalArgumentException: Can not set
> org.apache.cxf.jaxrs.ext.MessageContext field
> com.hexagrid.vxappstore.webservice.impl.AppstoreApplianceWebServiceImpl.mcto
> $Proxy87
>    at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:146)
>    at
> sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:150)
>    at
> sun.reflect.UnsafeFieldAccessorImpl.ensureObj(UnsafeFieldAccessorImpl.java:37)
>    at
> sun.reflect.UnsafeObjectFieldAccessorImpl.set(UnsafeObjectFieldAccessorImpl.java:57)
>    at java.lang.reflect.Field.set(Field.java:657)
>    at
> org.apache.cxf.jaxrs.utils.InjectionUtils$1.run(InjectionUtils.java:162)
>    at java.security.AccessController.doPrivileged(Native Method)
>    at
> org.apache.cxf.jaxrs.utils.InjectionUtils.injectFieldValue(InjectionUtils.java:158)
>    at
> org.apache.cxf.jaxrs.utils.InjectionUtils.injectContextProxiesAndApplication(InjectionUtils.java:815)
>    at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.injectContexts(JAXRSServerFactoryBean.java:324)
>    at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.updateClassResourceProviders(JAXRSServerFactoryBean.java:350)
>    at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:120)
>    ... 44 more
>
> I tried using a setter with @Context annotation but no luck.
>
> --
> Regards,
> Shashank Rachamalla
>



-- 
Sergey Beryozkin

Application Integration Division of Talend
http://sberyozkin.blogspot.com

Reply via email to