SOAPBindingUtil.getProxy can't load right class in OSGi
-------------------------------------------------------

                 Key: CXF-3184
                 URL: https://issues.apache.org/jira/browse/CXF-3184
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.3.1, 2.2.12
            Reporter: Willem Jiang
            Assignee: Willem Jiang
             Fix For: 2.3.2, 2.4


As a fix for CXF-3143 SOAPBindingUtil.getProxy uses now thread context 
classloader.
This causes the following problem:
{code}
Caused by: java.lang.IllegalArgumentException: interface 
org.apache.cxf.tools.common.extensions.soap.SoapBinding is not visible from 
class loader
        at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
        at 
org.apache.cxf.tools.util.SOAPBindingUtil.getProxy(SOAPBindingUtil.java:87)
        at 
org.apache.cxf.tools.util.SOAPBindingUtil.getSoapBinding(SOAPBindingUtil.java:274)
        at 
org.apache.cxf.tools.util.SOAPBindingUtil.createSoapBinding(SOAPBindingUtil.java:426)
        at 
org.apache.cxf.binding.soap.SoapBindingFactory.createSoapBinding(SoapBindingFactory.java:190)
        at 
org.apache.cxf.binding.soap.SoapBindingFactory.createBindingInfo(SoapBindingFactory.java:175)
        at 
org.apache.cxf.binding.AbstractBindingFactory.createBindingInfo(AbstractBindingFactory.java:80)
        at 
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createBindingInfo(AbstractWSDLBasedEndpointFactory.java:360)
        at 
org.apache.cxf.jaxws.JaxWsServerFactoryBean.createBindingInfo(JaxWsServerFactoryBean.java:160)
        at 
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpointInfo(AbstractWSDLBasedEndpointFactory.java:257)
        at 
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:145)
        at 
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:105)
        at 
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:177)
        at 
com.sabre.gateway.g2g.G2GInConnector.<init>(G2GInConnector.java:105)
        at 
com.sabre.gateway.g2g.G2GInConnector.<init>(G2GInConnector.java:76)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:126)
{code}

To avoid it we would to set context classloader to CXF bundle one before 
calling CXF code that causes this exception or import the cxf packages in our 
bundle and set context classloader to our bundle's one. 
Both solutions look like workarounds.

We need to make the SOAPBindingUtil.getProxy more smart to load  the class.

-- 
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