code: private UserRegistry autoDetectUserRegistry(boolean exceptionOnError) throws RegistryException {
          // Determine if there is a federation registry configured.
          UserRegistry ur = getFederationRegistry(exceptionOnError);
          synchronized (userRegistrySync) {
              if (ur != null) {
                  setRegistriesToBeFederated((FederationRegistry) ur, exceptionOnError);
                  isFederationActive = true;
                  return ur;
              } else
                  isFederationActive = false;
          }
  
          if (userRegistries.isEmpty()) {
              if (exceptionOnError) {
                  Tr.error(tc, "USER_REGISTRY_SERVICE_NO_USER_REGISTRY_AVAILABLE");
                  throw new RegistryException(TraceNLS.getFormattedMessage(this.getClass(), TraceConstants.MESSAGE_BUNDLE,
                                                                           "USER_REGISTRY_SERVICE_NO_USER_REGISTRY_AVAILABLE",
                                                                           new Object[] {},
                                                                           "CWWKS3005E: A configuration exception has occurred. No UserRegistry implementation service is available.  Ensure that you have a user registry configured."));
              } else {
                  return null;
              }
          } else if (urCount > 1) {
              if (exceptionOnError) {
                  Tr.error(tc, "USER_REGISTRY_SERVICE_MULTIPLE_USER_REGISTRY_AVAILABLE");
                  throw new RegistryException(TraceNLS.getFormattedMessage(
                                                                           this.getClass(),
                                                                           TraceConstants.MESSAGE_BUNDLE,
                                                                           "USER_REGISTRY_SERVICE_MULTIPLE_USER_REGISTRY_AVAILABLE",
                                                                           new Object[] {},
                                                                           "CWWKS3006E: A configuration error has occurred. Multiple available UserRegistry implementation services, unable to determine which to use."));
              } else {
                  return null;
              }
          } else {
              String id = userRegistries.keySet().iterator().next();
              return getUserRegistry(id, exceptionOnError);
          }
      }
docs: When a configuration element is not defined, use some "auto-detect"
  logic to try and return the single UserRegistry. If there is no
  service, or multiple services, that is considered an error case which
  "auto-detect" can not resolve.
  
  @return
  @throws RegistryException