cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1523071 - in /cxf/trunk: core/src/main/java/org/apache/cxf/common/util/ProxyClassLoader.java rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
Date Fri, 13 Sep 2013 19:51:41 GMT
Author: dkulp
Date: Fri Sep 13 19:51:41 2013
New Revision: 1523071

URL: http://svn.apache.org/r1523071
Log:
Revert back to the 2.7.6 classloader stuff for creating the proxy.  Its thus no worse than
2.7.6.  May need to re-look at this later.

Modified:
    cxf/trunk/core/src/main/java/org/apache/cxf/common/util/ProxyClassLoader.java
    cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java

Modified: cxf/trunk/core/src/main/java/org/apache/cxf/common/util/ProxyClassLoader.java
URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/common/util/ProxyClassLoader.java?rev=1523071&r1=1523070&r2=1523071&view=diff
==============================================================================
--- cxf/trunk/core/src/main/java/org/apache/cxf/common/util/ProxyClassLoader.java (original)
+++ cxf/trunk/core/src/main/java/org/apache/cxf/common/util/ProxyClassLoader.java Fri Sep
13 19:51:41 2013
@@ -24,13 +24,16 @@ import java.util.Set;
 
 /**
  * Utility class loader that can be used to create proxies in cases where
- * the the JAX-RS client classes are not visible to the loader of the
+ * the the client classes are not visible to the loader of the
  * service class.    
  */
 public class ProxyClassLoader extends ClassLoader {
     private Set<ClassLoader> loaders = new HashSet<ClassLoader>();
 
     public void addLoader(ClassLoader loader) {
+        if (loader == null) {
+            loader = getSystemClassLoader();
+        }
         loaders.add(loader);
     }
 
@@ -40,6 +43,8 @@ public class ProxyClassLoader extends Cl
                 return loader.loadClass(name);
             } catch (ClassNotFoundException cnfe) {
                 // Try next
+            } catch (NoClassDefFoundError cnfe) {
+                // Try next
             }
         }
         throw new ClassNotFoundException(name);

Modified: cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java?rev=1523071&r1=1523070&r2=1523071&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
(original)
+++ cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientProxyFactoryBean.java
Fri Sep 13 19:51:41 2013
@@ -32,7 +32,6 @@ import org.apache.cxf.binding.BindingCon
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
 import org.apache.cxf.common.classloader.ClassLoaderUtils.ClassLoaderHolder;
 import org.apache.cxf.common.injection.NoJSR250Annotations;
-import org.apache.cxf.common.util.ProxyClassLoader;
 import org.apache.cxf.common.util.ProxyHelper;
 import org.apache.cxf.configuration.Configurer;
 import org.apache.cxf.configuration.security.AuthorizationPolicy;
@@ -173,18 +172,9 @@ public class ClientProxyFactoryBean exte
     
             Class<?> classes[] = getImplementingClasses();
             
-            if (loader != null && loader != clientFactoryBean.getServiceClass().getClassLoader())
{
-                ProxyClassLoader pcl = new ProxyClassLoader();
-                pcl.addLoader(clientFactoryBean.getServiceClass().getClassLoader());
-                pcl.addLoader(loader);
-                loader = pcl;
-            }
-            
-            Object obj = ProxyHelper.getProxy(loader == null 
-                    ? clientFactoryBean.getServiceClass().getClassLoader()
-                        : loader,
-                                                classes,
-                                                handler);
+            Object obj = ProxyHelper.getProxy(clientFactoryBean.getServiceClass().getClassLoader(),
+                                              classes,
+                                              handler);
     
             this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PROXY_CREATED,
                                                classes, handler, obj);



Mime
View raw message