title: How do I configure WSO2 identity with LDAP?
body: <p>How do I configure WSO2 identity with LDAP?</p>
  
  <p>I changed my user-mgt.xml to:</p>
  
  <pre><code>    &lt;UserManager&gt;
      &lt;Realm&gt;
          &lt;Configuration&gt;
              &lt;AdminRole&gt;admin&lt;/AdminRole&gt;
              &lt;AdminUser&gt;
              &lt;UserName&gt;admin&lt;/UserName&gt;
              &lt;Password&gt;admin&lt;/Password&gt;
              &lt;/AdminUser&gt;
          &lt;EveryOneRoleName&gt;everyone&lt;/EveryOneRoleName&gt;
          &lt;Property name="url"&gt;jdbc:h2:repository/database/WSO2CARBON_DB;DB_CLOSE_ON_EXIT=FALSE&lt;/Property&gt;
          &lt;Property name="userName"&gt;wso2carbon&lt;/Property&gt;
          &lt;Property name="password"&gt;wso2carbon&lt;/Property&gt;
          &lt;Property name="driverName"&gt;org.h2.Driver&lt;/Property&gt;
          &lt;Property name="maxActive"&gt;50&lt;/Property&gt;
          &lt;Property name="maxWait"&gt;60000&lt;/Property&gt;
          &lt;Property name="minIdle"&gt;5&lt;/Property&gt;
          &lt;/Configuration&gt;
  
          &lt;UserStoreManager class="org.wso2.carbon.user.core.ldap.ApacheDSUserStoreManager"&gt;
          &lt;Property name="ReadOnly"&gt;true&lt;/Property&gt;
          &lt;Property name="ConnectionURL"&gt;ldap://ldap.curitiba.pr.gov.br:389&lt;/Property&gt;
          &lt;Property name="ConnectionName"&gt;o=ICI&lt;/Property&gt;
          &lt;Property name="UserNameListFilter"&gt;(objectClass=person)&lt;/Property&gt;
          &lt;Property name="UserEntryObjectClass"&gt;wso2Person&lt;/Property&gt;
          &lt;Property name="UserSearchBase"&gt;ou=users,dc=ICI,ou=domains,o=ICI&lt;/Property&gt;
          &lt;Property name="UserNameSearchFilter"&gt;(&amp;amp;(objectClass=person)(uid=?))&lt;/Property&gt;
          &lt;Property name="UserNameAttribute"&gt;uid&lt;/Property&gt;
          &lt;Property name="PasswordJavaScriptRegEx"&gt;[\\S]{5,30}&lt;/Property&gt;
          &lt;Property name="UsernameJavaScriptRegEx"&gt;[\\S]{3,30}&lt;/Property&gt;
          &lt;Property name="UsernameJavaRegEx"&gt;^[^~!@#$;%^*+={}\\|\\\\&amp;lt;&amp;gt;]{3,30}$&lt;/Property&gt;
          &lt;Property name="RolenameJavaScriptRegEx"&gt;[\\S]{3,30}&lt;/Property&gt;
          &lt;Property name="RolenameJavaRegEx"&gt;^[^~!@#$;%^*+={}\\|\\\\&amp;lt;&amp;gt;]{3,30}$&lt;/Property&gt;
          &lt;Property name="ReadLDAPGroups"&gt;false&lt;/Property&gt;
          &lt;Property name="WriteLDAPGroups"&gt;false&lt;/Property&gt;
          &lt;Property name="EmptyRolesAllowed"&gt;false&lt;/Property&gt;
          &lt;Property name="GroupSearchBase"&gt;ou=Groups,dc=wso2,dc=org&lt;/Property&gt;
          &lt;Property name="GroupNameListFilter"&gt;(objectClass=groupOfNames)&lt;/Property&gt;
          &lt;Property name="GroupEntryObjectClass"&gt;groupOfNames&lt;/Property&gt;
          &lt;Property name="GroupNameSearchFilter"&gt;(&amp;amp;(objectClass=groupOfNames)(cn=?))&lt;/Property&gt;
          &lt;Property name="GroupNameAttribute"&gt;cn&lt;/Property&gt;
          &lt;Property name="MembershipAttribute"&gt;member&lt;/Property&gt;
          &lt;Property name="UserRolesCacheEnabled"&gt;true&lt;/Property&gt;
          &lt;/UserStoreManager&gt; 
      &lt;/Realm&gt;
      &lt;/UserManager&gt;
  </code></pre>
  
  <p>but it doesn't work.</p>
  
  <p>Here is the contents of the log:</p>
  
  <pre><code>[2012-08-20 18:32:03,209]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Starting WSO2 Carbon...
  [2012-08-20 18:32:03,209]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Operating System : Linux 2.6.37.6-smp, i386
  [2012-08-20 18:32:03,209]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Java Home        : /usr/lib/java
  [2012-08-20 18:32:03,209]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Java Version     : 1.6.0_25
  [2012-08-20 18:32:03,210]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Java VM          : Java HotSpot(TM) Server VM 20.0-b11,Sun Microsystems Inc.
  [2012-08-20 18:32:03,210]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Carbon Home      : /soa/srvapp/IdentityServer
  [2012-08-20 18:32:03,210]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Java Temp Dir    : /soa/srvapp/IdentityServer/tmp
  [2012-08-20 18:32:03,210]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  User             : root, en-US, America/Sao_Paulo
  [2012-08-20 18:32:06,645]  INFO {org.wso2.carbon.ldap.server.configuration.LDAPConfigurationBuilder} -  KDC server is disabled.
  [2012-08-20 18:32:06,649]  INFO {org.wso2.carbon.ldap.server.DirectoryActivator} -  Initializing Directory Server with working directory /soa/srvapp/IdentityServer/repository/data/org.wso2.carbon.directory and port 10390
  [2012-08-20 18:32:10,665] ERROR {org.wso2.carbon.user.core.internal.Activator} -  Cannot start User Manager Core bundle
  java.lang.NullPointerException
          at org.wso2.carbon.user.core.config.RealmConfigXMLProcessor.buildRealmConfiguration(RealmConfigXMLProcessor.java:170)
          at org.wso2.carbon.user.core.common.DefaultRealmService.buildBootStrapRealmConfig(DefaultRealmService.java:150)
          at org.wso2.carbon.user.core.common.DefaultRealmService.&lt;init&gt;(DefaultRealmService.java:86)
          at org.wso2.carbon.user.core.common.DefaultRealmService.&lt;init&gt;(DefaultRealmService.java:124)
          at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:64)
          at org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:54)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:782)
          at java.security.AccessController.doPrivileged(Native Method)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:773)
          at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
          at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
          at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:370)
          at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1068)
          at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:557)
          at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:464)
          at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:248)
          at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:445)
          at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:220)
          at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:330)
  </code></pre>