Author: dkulp Date: Thu Aug 1 15:20:00 2013 New Revision: 1509282 URL: http://svn.apache.org/r1509282 Log: Merged revisions 1505758 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/branches/2.7.x-fixes
........ r1505758 | dkulp | 2013-07-22 14:17:51 -0400 (Mon, 22 Jul 2013) | 10 lines Merged revisions 1505746 via git cherry-pick from https://svn.apache.org/repos/asf/cxf/trunk ........ r1505746 | dkulp | 2013-07-22 13:52:14 -0400 (Mon, 22 Jul 2013) | 2 lines Try and throw the most useful of the exceptions ........ ........ Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java Modified: cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java?rev=1509282&r1=1509281&r2=1509282&view=diff ============================================================================== --- cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java (original) +++ cxf/branches/2.6.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/extension/Extension.java Thu Aug 1 15:20:00 2013 @@ -157,11 +157,14 @@ public class Extension { } protected Class<?> tryClass(String name, ClassLoader cl) { + Throwable origEx = null; if (classloader != null) { try { return classloader.loadClass(name); } catch (Throwable nex) { //ignore, fall into the stuff below + //save the exception though as this is likely the important one + origEx = nex; } } try { @@ -173,7 +176,10 @@ public class Extension { } catch (Throwable nex) { notFound = true; if (!optional) { - throw new ExtensionException(new Message("PROBLEM_LOADING_EXTENSION_CLASS", LOG, name), nex); + if (origEx != null) { + ex = origEx; + } + throw new ExtensionException(new Message("PROBLEM_LOADING_EXTENSION_CLASS", LOG, name), ex); } } }
