mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 14:52:24 +00:00
SEC-2659: ApacheDSContainer fails on import multiple ldif
This commit is contained in:
parent
8eb89e3f12
commit
143c513f5c
@ -18,6 +18,7 @@ package org.springframework.security.ldap.server;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
@ -204,7 +205,7 @@ public class ApacheDSContainer implements InitializingBean, DisposableBean, Life
|
|||||||
try {
|
try {
|
||||||
importLdifs();
|
importLdifs();
|
||||||
} catch (Exception e) {
|
} 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);
|
LdifFileLoader loader = new LdifFileLoader(service.getAdminSession(), ldifFile);
|
||||||
loader.execute();
|
loader.execute();
|
||||||
} else {
|
} 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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user