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

Refine classloader in org.apache.cxf.wsdl11.WSDLManagerImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6.2, 2.6.8
    • 2.5.11, 2.6.9, 2.7.6, 3.0.0-milestone1
    • None
    • None
    • Unknown

    Description

      I was packaging the CXF jars(e.g.cxf-rt-core-2.6.2.jar ) into a OSGi bundle then use it to create web service. In my scenario, it is found that if there are respect binding resources defined in the .war/META-INF/extensions.xml, it will not be properly loaded and will caused the "Unknown wsdl binding extension" error.
      After investigation, it's found that in the org.apache.cxf.wsdl11.WSDLManagerImpl.registerInitialXmlExtensions()method, the classloader is got by the following line:
      initialExtensions = PropertiesLoaderUtils.loadAllProperties(resource,

      • this.getClass().getClassLoader());
        And caused the classes defined in .war/META-INF/extensions.xml was not correctly loaded.
        I checked the similar scenario in org.apache.cxf.catalog.OASISCatalogManager.loadContextCatalogs and found it get classload like this:
        loadCatalogs(Thread.currentThread().getContextClassLoader(), name);

      So I tried to refine the classloader in WSDLManagerImpl like this and now it works in my test. Could someone help review this patch? Thanks in advance.

      Attachments

        1. CXF-5059.patch
          0.5 kB
          Bin Zhu

        Activity

          People

            ffang Freeman Yue Fang
            zhubinbj Bin Zhu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: