Give a better error message when custom data connectors cannot be loaded.
authorwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 1 Jul 2004 17:54:01 +0000 (17:54 +0000)
committerwassa <wassa@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 1 Jul 2004 17:54:01 +0000 (17:54 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1064 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/aa/attrresolv/provider/CustomDataConnector.java

index ae7e7c1..a3bf5ec 100644 (file)
@@ -88,8 +88,10 @@ public class CustomDataConnector implements DataConnectorPlugIn {
                                Object[] passElement = { e };
                                custom = (DataConnectorPlugIn) Class.forName(className).getConstructor(params).newInstance(passElement);
                        } catch (Exception loaderException) {
                                Object[] passElement = { e };
                                custom = (DataConnectorPlugIn) Class.forName(className).getConstructor(params).newInstance(passElement);
                        } catch (Exception loaderException) {
-                               log.error(
-                                       "Failed to load Custom Connector PlugIn implementation class: " + loaderException.getMessage());
+                               //Try to be a little smart about logging errors
+                               //For some reason the message is not set on ClassNotFoundException
+                               log.error("Failed to load Custom Connector PlugIn implementation class: "
+                                                + ((loaderException.getCause() != null) ? loaderException.getCause().getMessage() : loaderException.toString()));
                                throw new ResolutionPlugInException("Failed to initialize Connector PlugIn.");
                        }
                }
                                throw new ResolutionPlugInException("Failed to initialize Connector PlugIn.");
                        }
                }