cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [2/6] 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 Thu, 14 May 2015 19:33:05 GMT
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/67009674
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/67009674
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/67009674

Branch: refs/heads/3.0.x-fixes
Commit: 6700967415f3e9bb1e62dcab1ea4e8660ed579b8
Parents: 0e3ce7a
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri May 8 14:05:08 2015 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Thu May 14 15:14:32 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/67009674/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