From 6dc0733d9ed3c0450bedae87a695687139e67eab Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Mon, 16 Jun 2014 15:29:48 -0500 Subject: [PATCH] SEC-2659: ApacheDSContainer fails on import multiple ldif --- .../security/ldap/server/ApacheDSContainer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ldap/src/main/java/org/springframework/security/ldap/server/ApacheDSContainer.java b/ldap/src/main/java/org/springframework/security/ldap/server/ApacheDSContainer.java index 12549739b7..569f622d12 100644 --- a/ldap/src/main/java/org/springframework/security/ldap/server/ApacheDSContainer.java +++ b/ldap/src/main/java/org/springframework/security/ldap/server/ApacheDSContainer.java @@ -18,6 +18,7 @@ package org.springframework.security.ldap.server; import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.apache.commons.logging.Log; @@ -204,7 +205,7 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life try { importLdifs(); } catch (Exception e) { - logger.error("Failed to import LDIF file(s)", e); + throw new RuntimeException("Failed to import LDIF file(s)", e); } } @@ -262,7 +263,7 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life LdifFileLoader loader = new LdifFileLoader(service.getAdminSession(), ldifFile); loader.execute(); } else { - throw new IllegalArgumentException("More than one LDIF resource found with the supplied pattern:" + ldifResources); + throw new IllegalArgumentException("More than one LDIF resource found with the supplied pattern:" + ldifResources+ " Got " + Arrays.toString(ldifs)); } }