You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2007/04/04 15:39:47 UTC

svn commit: r525510 - /webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java

Author: dims
Date: Wed Apr  4 06:39:46 2007
New Revision: 525510

URL: http://svn.apache.org/viewvc?view=rev&rev=525510
Log:
try the context class loader and then fall back to default class loader

Modified:
    webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java

Modified: webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java?view=diff&rev=525510&r1=525509&r2=525510
==============================================================================
--- webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java (original)
+++ webservices/axis2/trunk/java/modules/metadata/src/org/apache/axis2/jaxws/description/builder/DescriptionBuilderUtils.java Wed Apr  4 06:39:46 2007
@@ -330,16 +330,23 @@
                                 + classToLoad + " using classloader: " + classLoader);
             }
         } else {
-            //Use the default classloader to load the class.
+            //Use the thread context class loader to load the class.
             try {
-                returnClass = forName(classToLoad);
+                returnClass = forName(classToLoad, false,
+                                   getContextClassLoader());
             }
-            //Catch Throwable as ClassLoader can throw an NoClassDefFoundError that
-            //does not extend Exception
             catch (Throwable ex) {
-                throw ExceptionFactory.makeWebServiceException(
-                        "DescriptionBuilderUtils: Class not found using default classloader for parameter: " +
-                                classToLoad);
+                //Use the default classloader to load the class.
+                try {
+                    returnClass = forName(classToLoad);
+                }
+                //Catch Throwable as ClassLoader can throw an NoClassDefFoundError that
+                //does not extend Exception
+                catch (Throwable ex2) {
+                    throw ExceptionFactory.makeWebServiceException(
+                            "DescriptionBuilderUtils: Class not found using default classloader for parameter: " +
+                                    classToLoad);
+                }
             }
         }
         return returnClass;



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org