]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - org.argeo.cms/src/org/argeo/cms/internal/runtime/CmsUserAdmin.java
Do not fail CMS initialisation if a user directory could not be found.
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / runtime / CmsUserAdmin.java
index ab98c062585684c9a536dc95a20644d7208dc1bf..ecb7b8c1c3355afe214ca32b933651b6f863bf42 100644 (file)
@@ -88,7 +88,7 @@ public class CmsUserAdmin extends AggregatingUserAdmin {
 
        protected List<Dictionary<String, Object>> getUserDirectoryConfigs() {
                List<Dictionary<String, Object>> res = new ArrayList<>();
-               Path nodeBase = cmsState.getDataPath(KernelConstants.DIR_NODE);
+               Path nodeBase = cmsState.getDataPath(KernelConstants.DIR_PRIVATE);
                List<String> uris = new ArrayList<>();
 
                // node roles
@@ -177,8 +177,13 @@ public class CmsUserAdmin extends AggregatingUserAdmin {
                        } catch (Exception e) {
                                throw new RuntimeException("Cannot interpret " + uri + " as an uri", e);
                        }
-                       Dictionary<String, Object> properties = DirectoryConf.uriAsProperties(u.toString());
-                       res.add(properties);
+
+                       try {
+                               Dictionary<String, Object> properties = DirectoryConf.uriAsProperties(u.toString());
+                               res.add(properties);
+                       } catch (Exception e) {
+                               log.error("Cannot load user directory " + u, e);
+                       }
                }
 
                return res;
@@ -191,7 +196,7 @@ public class CmsUserAdmin extends AggregatingUserAdmin {
                try {
                        if (uri == null) {
                                String baseDn = (String) properties.get(DirectoryConf.baseDn.name());
-                               u = KernelUtils.getOsgiInstanceUri(KernelConstants.DIR_NODE + '/' + baseDn + ".ldif");
+                               u = KernelUtils.getOsgiInstanceUri(KernelConstants.DIR_PRIVATE + '/' + baseDn + ".ldif");
                        } else if (realm != null) {
                                u = null;
                        } else {