docs: private void initDirectoryService(final File workDir) throws Exception {
          // Initialize the LDAP service
          Log.info(c, "initDirectoryService", "init");
          this.service = new DefaultDirectoryService();
          Log.info(c, "initDirectoryService", "DefaultDirectoryService init");
          this.service.setInstanceLayout(new InstanceLayout(workDir));
          Log.info(c, "initDirectoryService", "setInstanceLayout");
          final CacheService cacheService = new CacheService();
          Log.info(c, "initDirectoryService", "CacheService init");
          cacheService.initialize(this.service.getInstanceLayout());
          Log.info(c, "initDirectoryService", "CacheService initialized");
          this.service.setCacheService(cacheService);
          Log.info(c, "initDirectoryService", "CacheService set");
          /*
           * First load the schema
           */
          this.initSchemaPartition();
          Log.info(c, "initDirectoryService", "initSchemaPartition");
  
          /*
           * Then the system partition. This is a MANDATORY partition.
           * DO NOT add this via addPartition() method, trunk code complains about
           * duplicate partition while initializing.
           */
          final JdbmPartition systemPartition = new JdbmPartition(this.service.getSchemaManager());
          systemPartition.setId("system");
          systemPartition.setPartitionPath(new File(this.service.getInstanceLayout().getPartitionsDirectory(), systemPartition.getId()).toURI());
          systemPartition.setSuffixDn(new Dn(ServerDNConstants.SYSTEM_DN));
          systemPartition.setSchemaManager(this.service.getSchemaManager());
  
          // mandatory to call this method to set the system partition
          // Note: this system partition might be removed from trunk
          this.service.setSystemPartition(systemPartition);
  
          Log.info(c, "initDirectoryService", "setSystemPartition");
  
          /*
           * Disable the ChangeLog system
           */
          this.service.getChangeLog().setEnabled(false);
          this.service.setDenormalizeOpAttrsEnabled(true);
  
          /*
           * Start the service.
           */
          Log.info(c, "initDirectoryService", "starting service");
          this.service.startup();
          Log.info(c, "initDirectoryService", "started service");
  
          /*
           * Add Microsoft schema for sAMAccountName and memberOf.
           * These two attributes are not defined in ApacheDS.
           */
          Entry entry = newEntry("cn=microsoft, ou=schema");
          entry.add("objectclass", "metaSchema");
          entry.add("objectclass", "top");
          entry.add("cn", "microsoft");
          add(entry);
  
          entry = newEntry("ou=attributetypes, cn=microsoft, ou=schema");
          entry.add("objectclass", "organizationalUnit");
          entry.add("objectclass", "top");
          entry.add("ou", "attributetypes");
          add(entry);
  
          entry = newEntry("m-oid=1.2.840.113556.1.4.221, ou=attributetypes, cn=microsoft, ou=schema");
          entry.add("objectclass", "metaAttributeType");
          entry.add("objectclass", "metaTop");
          entry.add("objectclass", "top");
          entry.add("m-oid", "1.2.840.113556.1.4.221");
          entry.add("m-name", "sAMAccountName");
          entry.add("m-equality", "caseIgnoreMatch");
          entry.add("m-syntax", "1.3.6.1.4.1.1466.115.121.1.15");
          entry.add("m-singleValue", "TRUE");
          add(entry);
  
          entry = newEntry("m-oid=1.2.840.113556.1.4.222, ou=attributetypes, cn=microsoft, ou=schema");
          entry.add("objectclass", "metaAttributeType");
          entry.add("objectclass", "metaTop");
          entry.add("objectclass", "top");
          entry.add("m-oid", "1.2.840.113556.1.4.222");
          entry.add("m-name", "memberOf");
          entry.add("m-equality", "caseIgnoreMatch");
          entry.add("m-syntax", "1.3.6.1.4.1.1466.115.121.1.15");
          entry.add("m-singleValue", "FALSE");
          add(entry);
  
          entry = newEntry("ou=objectclasses, cn=microsoft, ou=schema");
          entry.add("objectclass", "organizationalUnit");
          entry.add("objectclass", "top");
          entry.add("ou", "objectClasses");
          add(entry);
  
          entry = newEntry("m-oid=1.2.840.113556.1.5.6, ou=objectclasses, cn=microsoft, ou=schema");
          entry.add("objectclass", "metaObjectClass");
          entry.add("objectclass", "metaTop");
          entry.add("objectclass", "top");
          entry.add("m-oid", "1.2.840.113556.1.5.6");
          entry.add("m-name", "simulatedMicrosoftSecurityPrincipal");
          entry.add("m-supObjectClass", "top");
          entry.add("m-typeObjectClass", "AUXILIARY");
          entry.add("m-must", "sAMAccountName");
          entry.add("m-may", "memberOf");
          add(entry);
  
          Log.info(c, "initDirectoryService", "added microsoft attributes");
  
          /*
           * Initialize some WIM specific schema.
           */
          this.initWimAttributes();
          this.initWimObjectClasses();
      }