You might need to add <aop:scoped-proxy/>
into the cxf configuration file:
<jaxrs:server id="example" address="/">
<jaxrs:serviceBeans>
<bean class="org.apache.cxf.systest.jaxrs.CustomerService">
<aop:scoped-proxy />
</bean>
</jaxrs:serviceBeans>
</jaxrs:server>
Also you have to create a setter method for your messageContext (this should be in your service class - here it is "org.apache.cxf.systest.jaxrs.CustomerService"):
private MessageContext messageContext;
@Context
public void setMessageContext(MessageContext messageContext) {
this.messageContext = messageContext;
}
Consider also this documentation link:
http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-FromSpring