title: WSO2 Identity Server error starting, cannot find admin
body: <p>Starting WSO2 Identity Server for the first time gives me this error:</p>
  
  <blockquote>
    <p>"Caused by: org.wso2.carbon.user.core.UserStoreException: Admin user
    can not be created in primary user store. User store is read only.
    Please pick a user name which is exist in the primary user store as
    Admin user"</p>
  </blockquote>
  
  <pre><code>&lt;UserManager&gt;
  &lt;Realm&gt;
      &lt;Configuration&gt;
          &lt;AddAdmin&gt;false&lt;/AddAdmin&gt;
          &lt;AdminRole&gt;admins&lt;/AdminRole&gt;
          &lt;AdminUser&gt;
              &lt;UserName&gt;cn=Directory Manager&lt;/UserName&gt;
              &lt;Password&gt;xxxxxxxx&lt;/Password&gt;
          &lt;/AdminUser&gt;
          &lt;EveryOneRoleName&gt;everyone&lt;/EveryOneRoleName&gt; &lt;!-- By default users in this role sees the registry root --&gt;
          &lt;Property name="dataSource"&gt;jdbc/WSO2CarbonDB&lt;/Property&gt;
      &lt;/Configuration&gt;
  
  
      &lt;UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager"&gt;
          &lt;Property name="TenantManager"&gt;org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager&lt;/Property&gt;
          &lt;Property name="ConnectionURL"&gt;ldap://localhost:389&lt;/Property&gt;
          &lt;Property name="ConnectionName"&gt;cn=Directory Manager&lt;/Property&gt;
          &lt;Property name="ReadOnly"&gt;true&lt;/Property&gt;
          &lt;Property name="ConnectionPassword"&gt;oursecretpassword&lt;/Property&gt;
          &lt;Property name="passwordHashMethod"&gt;PLAIN_TEXT&lt;/Property&gt;
          &lt;Property name="UserNameListFilter"&gt;(objectClass=person)&lt;/Property&gt;
          &lt;Property name="UserEntryObjectClass"&gt;pccperson&lt;/Property&gt;
          &lt;Property name="UserSearchBase"&gt;ou=People,dc=pcc.edu,dc=cp&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;[a-zA-Z0-9._-|//]{3,30}$&lt;/Property&gt;
          &lt;Property name="RolenameJavaScriptRegEx"&gt;^[\S]{3,30}$&lt;/Property&gt;
          &lt;Property name="RolenameJavaRegEx"&gt;[a-zA-Z0-9._-|//]{3,30}$&lt;/Property&gt;
          &lt;Property name="ReadGroups"&gt;true&lt;/Property&gt;
          &lt;Property name="WriteGroups"&gt;false&lt;/Property&gt;
          &lt;Property name="EmptyRolesAllowed"&gt;true&lt;/Property&gt;
          &lt;Property name="GroupSearchBase"&gt;ou=Groups,dc=pcc,dc=edu&lt;/Property&gt;
          &lt;Property name="GroupNameListFilter"&gt;(objectClass=groupofuniquenames)&lt;/Property&gt;
          &lt;Property name="GroupEntryObjectClass"&gt;groupofuniquenames&lt;/Property&gt;
          &lt;Property name="GroupNameSearchFilter"&gt;(&amp;amp;(objectClass=groupofuniquenames)(cn=?))&lt;/Property&gt;
          &lt;Property name="GroupNameAttribute"&gt;cn&lt;/Property&gt;
          &lt;Property name="MembershipAttribute"&gt;uniqueMember&lt;/Property&gt;
          &lt;Property name="UserRolesCacheEnabled"&gt;true&lt;/Property&gt;
          &lt;Property name="MaxRoleNameListLength"&gt;100&lt;/Property&gt;
          &lt;Property name="MaxUserNameListLength"&gt;100&lt;/Property&gt;
          &lt;Property name="SCIMEnabled"&gt;false&lt;/Property&gt;
      &lt;/UserStoreManager&gt;
  </code></pre>
  
  
  
  <blockquote>
    <p>TID: [0] [IS] [2015-05-22 11:35:10,888]  INFO {org.wso2.carbon.user.core.common.DefaultRealmService} -  Database already exists. Not creating a new database. {org.wso2.carbon.user.core.common.DefaultRealmService}
    TID: [0] [IS] [2015-05-22 11:35:11,233]  INFO {org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager} -  LDAP connection created successfully in read-only mode {org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager}
    TID: [0] [IS] [2015-05-22 11:35:11,841] ERROR {org.wso2.carbon.user.core.common.DefaultRealm} -  Cannot create org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager {org.wso2.carbon.user.core.common.DefaultRealm}
    java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
            at org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:329)
            at org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:195)
            at org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:104)
            at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:223)
            at org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:101)
            at org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:114)
            at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:69)
            at org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
            at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
            at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
            at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
            at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
    Caused by: org.wso2.carbon.user.core.UserStoreException: Admin user can not be created in primary user store. User store is read only. Please pick a user name which is exist in the primary user store as Admin user
            at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addInitialAdminData(AbstractUserStoreManager.java:3206)
            at org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:166)
            at org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:97)
            ... 27 more
    TID: [0] [IS] [2015-05-22 11:35:11,844] ERROR {org.wso2.carbon.user.core.common.DefaultRealmService} -  Cannot initialize the realm. {org.wso2.carbon.user.core.common.DefaultRealmService}
    org.wso2.carbon.user.core.UserStoreException: nullType class java.lang.reflect.InvocationTargetException
            at org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:370)
            at org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:195)
            at org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:104)
            at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:223)
            at org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:101)
            at org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:114)
            at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:69)
            at org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
            at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
            at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
            at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
            at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
            at org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:329)
            ... 22 more
    Caused by: org.wso2.carbon.user.core.UserStoreException: Admin user can not be created in primary user store. User store is read only. Please pick a user name which is exist in the primary user store as Admin user
            at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addInitialAdminData(AbstractUserStoreManager.java:3206)
            at org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:166)
            at org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:97)
            ... 27 more
    TID: [0] [IS] [2015-05-22 11:35:11,845] ERROR {org.wso2.carbon.user.core.internal.Activator} -  Cannot start User Manager Core bundle {org.wso2.carbon.user.core.internal.Activator}
    org.wso2.carbon.user.core.UserStoreException: Cannot initialize the realm.
            at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:231)
            at org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:101)
            at org.wso2.carbon.user.core.common.DefaultRealmService.(DefaultRealmService.java:114)
            at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:69)
            at org.wso2.carbon.user.core.internal.BundleCheckActivator.start(BundleCheckActivator.java:61)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711)
            at java.security.AccessController.doPrivileged(Native Method)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702)
            at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
            at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
            at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
            at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
            at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
            at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
            at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
    Caused by: org.wso2.carbon.user.core.UserStoreException: nullType class java.lang.reflect.InvocationTargetException
            at org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:370)
            at org.wso2.carbon.user.core.common.DefaultRealm.initializeObjects(DefaultRealm.java:195)
            at org.wso2.carbon.user.core.common.DefaultRealm.init(DefaultRealm.java:104)
            at org.wso2.carbon.user.core.common.DefaultRealmService.initializeRealm(DefaultRealmService.java:223)
            ... 19 more
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
            at org.wso2.carbon.user.core.common.DefaultRealm.createObjectWithOptions(DefaultRealm.java:329)
            ... 22 more
    Caused by: org.wso2.carbon.user.core.UserStoreException: Admin user can not be created in primary user store. User store is read only. Please pick a user name which is exist in the primary user store as Admin user
            at org.wso2.carbon.user.core.common.AbstractUserStoreManager.addInitialAdminData(AbstractUserStoreManager.java:3206)
            at org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:166)
            at org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager.(ReadOnlyLDAPUserStoreManager.java:97)
            ... 27 more</p>
  </blockquote>
  
  <p>I've tried setting AdminRole to <code>'admins' and 'cn=admins'</code>.  Same error either way.</p>
  
  <p>I don't have a ton of experience setting up LDAP servers from scratch, but I think I installed 389-DS correctly.  </p>
  
  <p>See my group entry:</p>
  
  <blockquote>
    <p>ldapsearch -b "cn=Admins,ou=Groups,dc=pcc,dc=edu" -D "cn=Directory
    Manager" -W  cn=* Enter LDAP Password:</p>
    
    <p>dn: cn=admins,ou=Groups,dc=pcc,dc=edu objectClass: top objectClass:
    groupofuniquenames uniqueMember: uid=jwhitene,ou=People,dc=pcc,dc=edu
    cn: admins</p>
  </blockquote>