Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3184

SOAPBindingUtil.getProxy can't load right class in OSGi

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.12, 2.3.1
    • 2.3.2, 2.4
    • None
    • None

    Description

      As a fix for CXF-3143 SOAPBindingUtil.getProxy uses now thread context classloader.
      This causes the following problem:

      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)
      

      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.

      Attachments

        Activity

          People

            njiang Willem Jiang
            njiang Willem Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: