cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject cxf git commit: In osgi, the bundle that uses a client MAY have imports for some of the cxf stuff (like the Client interface), but not all the params and return types. That causes client creation failures.
Date Fri, 08 May 2015 18:12:32 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 159089a4c -> cf76f94d7


In osgi, the bundle that uses a client MAY have imports for some of the cxf stuff (like the
Client interface), but not all the params and return types.  That causes client creation failures.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/cf76f94d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/cf76f94d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/cf76f94d

Branch: refs/heads/master
Commit: cf76f94d75a2a56173df9f7917ce3a011253f620
Parents: 159089a
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri May 8 14:05:08 2015 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri May 8 14:05:08 2015 -0400

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/common/util/ProxyHelper.java | 10 ++++++++++
 1 file changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/cf76f94d/core/src/main/java/org/apache/cxf/common/util/ProxyHelper.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/cxf/common/util/ProxyHelper.java b/core/src/main/java/org/apache/cxf/common/util/ProxyHelper.java
index 27f2c56..89bdad3 100644
--- a/core/src/main/java/org/apache/cxf/common/util/ProxyHelper.java
+++ b/core/src/main/java/org/apache/cxf/common/util/ProxyHelper.java
@@ -20,6 +20,7 @@
 package org.apache.cxf.common.util;
 
 import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 
 /**
@@ -73,6 +74,15 @@ public class ProxyHelper {
                 if (ifClass != currentInterface) {
                     return false;
                 }
+                //we need to check all the params/returns as well as the Proxy creation 
+                //will try to create methods for all of this even if they aren't used
+                //by the client and not available in the clients classloader
+                for (Method m : ifClass.getMethods()) {
+                    Class.forName(m.getReturnType().getName(), true, loader);
+                    for (Class<?> p : m.getParameterTypes()) {
+                        Class.forName(p.getName(), true, loader);
+                    }
+                }
             } catch (NoClassDefFoundError e) {
                 return false;
             } catch (ClassNotFoundException e) {


Mime
View raw message