@Test public void testCheckAndFixContextClassLoaderWithTestClassLoader() { ClassLoader orig = Thread.currentThread().getContextClassLoader(); try { ClassLoader testCl = new TestClassLoader(); assertFalse(canLoad(testCl, ProviderImpl.class.getName())); Thread.currentThread().setContextClassLoader(testCl); assertTrue(ProviderImpl.checkAndFixContextClassLoader(testCl)); ClassLoader modifiedTccl = Thread.currentThread().getContextClassLoader(); assertNotNull(modifiedTccl); assertTrue(modifiedTccl instanceof DelegateClassLoader); verifyClassLoaderCanLoadProviderImpl(modifiedTccl); } finally { Thread.currentThread().setContextClassLoader(orig); } }
static boolean checkAndFixContextClassLoader(ClassLoader origClassLoader) { try { origClassLoader.loadClass(ProviderImpl.class.getName()); } catch (Exception e) { ClassLoader clientClassLoader = ProviderImpl.class.getClassLoader(); if (BusFactory.getDefaultBus(false) == null) { JBossWSBusFactory.getDefaultBus(clientClassLoader); } setContextClassLoader(createDelegateClassLoader(clientClassLoader, origClassLoader)); return true; } return false; }
ProviderImpl extends org.apache.cxf.jaxws22.spi.ProviderImpl { static boolean checkAndFixContextClassLoader(ClassLoader origClassLoader) { try { origClassLoader.loadClass(ProviderImpl.class.getName()); } catch (Exception e) { ClassLoader clientClassLoader = ProviderImpl.class.getClassLoader(); if (BusFactory.getDefaultBus(false) == null) { JBossWSBusFactory.getDefaultBus(clientClassLoader); } setContextClassLoader(createDelegateClassLoader(clientClassLoader, origClassLoader)); return true; } return false; } }
ProviderImpl extends org.apache.cxf.jaxws22.spi.ProviderImpl { static boolean checkAndFixContextClassLoader(ClassLoader origClassLoader) { try { origClassLoader.loadClass(ProviderImpl.class.getName()); } catch (Exception e) { ClassLoader clientClassLoader = ProviderImpl.class.getClassLoader(); if (BusFactory.getDefaultBus(false) == null) { JBossWSBusFactory.getDefaultBus(clientClassLoader); } setContextClassLoader(createDelegateClassLoader(clientClassLoader, origClassLoader)); return true; } return false; }  }
ProviderImpl extends org.apache.cxf.jaxws22.spi.ProviderImpl { static boolean checkAndFixContextClassLoader(ClassLoader origClassLoader) { try { origClassLoader.loadClass(ProviderImpl.class.getName()); } catch (Exception e) { ClassLoader clientClassLoader = ProviderImpl.class.getClassLoader(); if (BusFactory.getDefaultBus(false) == null) { JBossWSBusFactory.getDefaultBus(clientClassLoader); } setContextClassLoader(createDelegateClassLoader(clientClassLoader, origClassLoader)); return true; } return false; }  @Override Endpoint createEndpoint(String bindingId, Object implementor); @Override Endpoint createEndpoint(String bindingId,
         Object implementor,
         WebServiceFeature ... features); @Override Endpoint createEndpoint(String bindingId, Class<?> implementorClass,
         Invoker invoker, WebServiceFeature ... features); @SuppressWarnings("rawtypes") @Override ServiceDelegate createServiceDelegate(URL url, QName qname, Class cls); @SuppressWarnings("rawtypes") @Override ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass,
         WebServiceFeature... features); }
ProviderImpl extends org.apache.cxf.jaxws22.spi.ProviderImpl { static boolean checkAndFixContextClassLoader(ClassLoader origClassLoader) { try { origClassLoader.loadClass(ProviderImpl.class.getName()); } catch (Exception e) { ClassLoader clientClassLoader = ProviderImpl.class.getClassLoader(); if (BusFactory.getDefaultBus(false) == null) { JBossWSBusFactory.getDefaultBus(clientClassLoader); } setContextClassLoader(createDelegateClassLoader(clientClassLoader, origClassLoader)); return true; } return false; }  @Override Endpoint createEndpoint(String bindingId, Object implementor); @Override Endpoint createEndpoint(String bindingId,
         Object implementor,
         WebServiceFeature ... features); @Override Endpoint createEndpoint(String bindingId, Class<?> implementorClass,
         Invoker invoker, WebServiceFeature ... features); @SuppressWarnings("rawtypes") @Override ServiceDelegate createServiceDelegate(URL url, QName qname, Class cls); @SuppressWarnings("rawtypes") @Override ServiceDelegate createServiceDelegate(URL wsdlDocumentLocation, QName serviceName, Class serviceClass,
         WebServiceFeature... features);  }