cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1048931 - in /cxf/branches/2.3.x-fixes: ./ tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
Date Tue, 14 Dec 2010 04:09:16 GMT
Author: ningjiang
Date: Tue Dec 14 04:09:16 2010
New Revision: 1048931

URL: http://svn.apache.org/viewvc?rev=1048931&view=rev
Log:
Merged revisions 1048919 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1048919 | ningjiang | 2010-12-14 11:27:10 +0800 (Tue, 14 Dec 2010) | 1 line
  
  CXF-3184 Fixed the issue of SOAPBindingUtil.getProxy in OSGi
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Dec 14 04:09:16 2010
@@ -1 +1 @@
-/cxf/trunk:1041183,1041790,1041993,1042346,1042571,1042724,1042805,1042821,1043225,1043229,1043902,1043907,1043954,1044085,1044238-1044305,1045024,1048915
+/cxf/trunk:1041183,1041790,1041993,1042346,1042571,1042724,1042805,1042821,1043225,1043229,1043902,1043907,1043954,1044085,1044238-1044305,1045024,1048915,1048919

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java?rev=1048931&r1=1048930&r2=1048931&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
(original)
+++ cxf/branches/2.3.x-fixes/tools/common/src/main/java/org/apache/cxf/tools/util/SOAPBindingUtil.java
Tue Dec 14 04:09:16 2010
@@ -84,8 +84,20 @@ public final class SOAPBindingUtil {
         /*
          * If we put proxies into the loader of the proxied class, they'll just pile up.
          */
-        Object proxy = Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
+        Object proxy = null;
+        try {
+            proxy = Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
                                               new Class[] {cls}, ih);
+        } catch (IllegalArgumentException ex) {
+            // Using cls classloader as a fallback to make it work within OSGi  
+            ClassLoader contextLoader = Thread.currentThread().getContextClassLoader();
+            if (contextLoader != cls.getClassLoader()) {
+                proxy = Proxy.newProxyInstance(cls.getClassLoader(),
+                                              new Class[] {cls}, ih);
+            } else {
+                throw ex;
+            }
+        }
         return cls.cast(proxy);
     }
 



Mime
View raw message