Log full exception chain.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 12 May 2004 03:03:41 +0000 (03:03 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Wed, 12 May 2004 03:03:41 +0000 (03:03 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1053 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/common/TargetFederationComponent.java

index 48d9096..928d422 100644 (file)
@@ -26,7 +26,6 @@
 
 package edu.internet2.middleware.shibboleth.common;
 
-import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
 import java.util.Iterator;
 
@@ -95,9 +94,11 @@ class FederationProviderFactory {
                                return (Metadata) Class.forName(className).getConstructor(params).newInstance(new Object[]{e});
                        } catch (Exception loaderException) {
                                log.error("Failed to load Federation Provider implementation class: " + loaderException);
-                               if (loaderException instanceof InvocationTargetException) {
-                                       log.error("Root cause: " + ((InvocationTargetException)loaderException).getTargetException());
-                               }
+                Throwable cause = loaderException.getCause();
+                while (cause != null) {
+                                       log.error("caused by: " + cause);
+                    cause = cause.getCause();
+                }
                                throw new MetadataException("Failed to initialize Federation Provider.");
                        }
                }