[ 
https://issues.apache.org/jira/browse/CXF-2534?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12777587#action_12777587
 ] 

Daniel Kulp commented on CXF-2534:
----------------------------------


This is working as designed and per jsr250 spec.    If you want the resource 
injected through methods you put @Resource on a method like:


private WebServiceContext webServiceContext; 

@Resouce
public void setContext(WebServiceContext ctx) {
    webServiceContext = ctx;
}

> ResourceInjector (CXF class) works on Fields (using Reflections API) rather 
> than on methods
> -------------------------------------------------------------------------------------------
>
>                 Key: CXF-2534
>                 URL: https://issues.apache.org/jira/browse/CXF-2534
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.2.3
>         Environment: All env (windows, Linux)
>            Reporter: Karuna
>
> In JAX-WS java-first webservice using CXF and Spring, Service Implementor 
> class can not have custom annotations when  the following @Resource is added 
> to implementor class.
> @Resource
> private WebServiceContext webServiceContext;
> This is because in order to enable Spring-AOP, jaxws:endpoint XML config 
> should be like this
>  
> <jaxws:endpoint  id="XXXService" 
>    implementorClass="com.xxx.ws.soap.XXXServiceImpl"
>    implementor="#xxxServiceImpl" 
>   address="/XXXService"/>
>  
> Because of this, since Spring works on proxies, somehow, @Resource 
> (WebServiceContext ) is failing. This is because ResourceInjector (CXF class) 
> works on Fields (using Reflections API) rather than on methods. If the 
> accessing of WebServiceContext is done using Methods (Reflections API),  it 
> would not be a problem because proxies have methods too.
>  
> So it appears that, any custom annotations in CXF implementor classes can not 
> be added when @Resource is added. @Resource should be accessed using methods 
> rather than at Fields.
>  
>  

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to