[ 
https://issues.apache.org/jira/browse/ARIES-1140?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13847334#comment-13847334
 ] 

Christian Schneider commented on ARIES-1140:
--------------------------------------------

The CRMService interface can be a pure business logic interface. It does not 
implement BindingProvider. Honestly I think that the JAX-WS spec that requires 
the jaxws proxy to implement BindingProvider is not very good. It already gaves 
as some headaches about proxy generation in cxf as CRMService and 
BindingProvider may not be available in the same bundle classloader. So it will 
not be possible to fullfill the spec with a blueprint injected proxy. 

I just discussed with Andrei. We will check if we can add an additional api in 
cxf to retrieve the BindingProvider for a given proxy. I am not sure though if 
this is feasible as the blueprint proxy of a cxf proxy may not have enough 
information. We will do some experimentation and report back what we found.

In any case I think blueprint acts correctly here as Richard described and we 
have to find some other way to make this work.




> Injected java.lang.reflect.Proxy implements only single interface
> -----------------------------------------------------------------
>
>                 Key: ARIES-1140
>                 URL: https://issues.apache.org/jira/browse/ARIES-1140
>             Project: Aries
>          Issue Type: Improvement
>          Components: Proxy
>    Affects Versions: proxy-impl-1.0.1
>            Reporter: Andrei Shakirin
>
> Hi,
> I have a problem in using Blueprint together with CXF and Karaf projects. The 
> use case is quite trivial: I inject OSGi service into java class source. This 
> OSGi service is exposed by declared jax-ws client.
> 1. Blueprint configuration exporting service:
> {code:xml}
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
> xmlns:cxf="http://cxf.apache.org/blueprint/core";
>     xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws";
>     xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
>                         http://cxf.apache.org/blueprint/jaxws 
> http://cxf.apache.org/schemas/blueprint/jaxws.xsd
>                         http://cxf.apache.org/blueprint/core 
> http://cxf.apache.org/schemas/blueprint/core.xsd
>     ">
>     <jaxws:client id="crmClient"
>         xmlns:serviceNamespace="http://services.talend.org/CRMService";
>         serviceClass="org.talend.services.crmservice.CRMService"
>         serviceName="serviceNamespace:CRMServiceProvider"
>         endpointName="serviceNamespace:CRMServicePort"
>         address="http://localhost:8080/service/CRMService"/>
>      <service ref="crmClient" 
> interface="org.talend.services.crmservice.CRMService" />
> </blueprint>
> {code}
> Where org.talend.services.crmservice.CRMService is generated jax-ws interface
> 2. Blueprint configuration importing service:
> {code:xml}
> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";   
> xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 
> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd";>
>       <reference id="CRMServiceClient" 
> interface="org.talend.services.crmservice.CRMService" />
>       <bean id="TestClass"
>               class="org.talend..demo.TestClass">
>               <property name="crms" ref="CRMServiceClient" />
>       </bean>
> </blueprint>
> {code}
> 3. Code in TestClass:
> {code:java}
> ...
>     private CRMService crms;
>     public void setCrms(CRMService crms) {
>         this.crms = crms;
>         System.out.println(crms.getClass());
>         System.out.println(crms.toString());
>         System.out.println(crms instanceof BindingProvider);
>     }
> ...
> {code}
> Problem:
> The problem is that crms proxy, injected into TestClass, implements only 
> org.talend.services.crmservice.CRMService.
> The proxy calls methods of org.apache.cxf.jaxws.JaxWsClientProxy which 
> implements javax.xml.ws.BindingProvider interface. I expect that crms proxy 
> also implements javax.xml.ws.BindingProvider, but it is not the case. I have 
> the following output from setCrms:
> class com.sun.proxy.$Proxy151
> org.apache.cxf.jaxws.JaxWsClientProxy@c3f8b42
> false
> The proxy calls toString() method of JaxWsClientProxy, but it is not instance 
> of BindingProvider interface. The problem is that this proxy is not jax-ws 
> compatible, because spec requires that all proxies implementing 
> BindingProvider interface.
> Interesting that Spring DM proxy hasn't such problem: it implements 
> BindingProvider interface in this scenario.
> Is it Blueprint problem? (seems to be true for me)
> Is there way to fix this in Blueprint?
> Regards,
> Andrei.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Reply via email to