2

We've setup up WSO2 Governance Registry 5.1.0 as a Windows service using JDK 1.8.0_65. The local setup was working but now we want it to connect to AD using LDAP readonly. Followed the documentation on the site and lot of blog posts and Stack Overflow issues, but none of the answers seem to be working.

<UserManager>
<Realm>
    <Configuration>
            <AddAdmin>false</AddAdmin>
            <AdminRole>WS02Admins</AdminRole>
            <AdminUser>
                 <UserName>DOMAIN_NAME\wso2user</UserName>
                 <Password>xxxxxxxx</Password>
            </AdminUser>
        <EveryOneRoleName>everyone</EveryOneRoleName> <!-- By default users in this role sees the registry root -->
        <Property name="dataSource">jdbc/WSO2CarbonDB</Property>
    </Configuration>

    <UserStoreManager class="org.wso2.carbon.user.core.ldap.ReadOnlyLDAPUserStoreManager"> 
        <Property name="TenantManager">org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager</Property>
        <!-- <Property name="ReadOnly">true</Property>  -->
        <!-- <Property name="Disabled">false</Property> -->
        <Property name="MaxUserNameListLength">0</Property>         
        <Property name="ConnectionURL">ldap://WSO2SERVER.business-post.com</Property>
        <Property name="ConnectionName">cn=wso2user,ou=Accounts,ou=WSO2,dc=companyname,dc=com</Property>
        <Property name="ConnectionPassword">test</Property>
        <Property name="UserSearchBase">ou=Accounts,ou=WSO2,dc=companyname,dc=com</Property>
        <Property name="UserNameListFilter">(objectClass=User)</Property>
        <Property name="UserNameAttribute">cn</Property>
        <Property name="ReadGroups">false</Property>
        <Property name="GroupSearchBase">ou=Accounts,ou=WSO2,dc=business-post,dc=com</Property>
        <Property name="GroupSearchFilter">(objectClass=Group)</Property>
        <Property name="GroupNameAttribute">cn</Property>
        <Property name="MembershipAttribute">member</Property> 
        <Property name="ReplaceEscapeCharactersAtUserLogin">true</Property>
    </UserStoreManager>

    <AuthorizationManager
        class="org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager">
        <Property name="AdminRoleManagementPermissions">/permission</Property>
        <Property name="AuthorizationCacheEnabled">true</Property>  
        <Property name="GetAllRolesOfUserEnabled">true</Property>
    </AuthorizationManager>
</Realm>

Log file

TID: [-1] [] [2016-01-13 16:53:01,440]  WARN {org.apache.axiom.util.stax.dialect.StAXDialectDetector} -  Unable to determine dialect of the StAX implementation at bundleresource://14.fwk982757413/ {org.apache.axiom.util.stax.dialect.StAXDialectDetector}
TID: [-1] [] [2016-01-13 16:53:01,425]  WARN {org.apache.axiom.util.stax.dialect.StAXDialectDetector} -  Unable to determine dialect of the StAX implementation at bundleresource://14.fwk982757413/ {org.apache.axiom.util.stax.dialect.StAXDialectDetector}
TID: [-1234] [] [2016-01-13 16:53:01,846]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Starting WSO2 Carbon... {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [-1234] [] [2016-01-13 16:53:01,846]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Operating System : Windows Server 2012 R2 6.3, amd64 {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [-1234] [] [2016-01-13 16:53:01,846]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Java Home        : C:\Program Files\Java\jdk1.8.0_65\jre {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [-1234] [] [2016-01-13 16:53:01,846]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Java Version     : 1.8.0_65 {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [-1234] [] [2016-01-13 16:53:01,846]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Java VM          : Java HotSpot(TM) 64-Bit Server VM 25.65-b01,Oracle Corporation {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [-1234] [] [2016-01-13 16:53:01,846]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Carbon Home      : C:\WSO2 Service Registry {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [-1234] [] [2016-01-13 16:53:01,846]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  Java Temp Dir    : C:\WSO2 Service Registry\tmp {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [-1234] [] [2016-01-13 16:53:01,846]  INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} -  User             : SERVER$, en-GB, Europe/London {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [-1234] [] [2016-01-13 16:53:03,323]  WARN {org.wso2.carbon.core.bootup.validator.util.ValidationResultPrinter} -  The running OS : Windows Server 2012 R2 is not a tested Operating System for running WSO2 Carbon {org.wso2.carbon.core.bootup.validator.util.ValidationResultPrinter}
TID: [-1234] [] [2016-01-13 16:53:03,323]  WARN {org.wso2.carbon.core.bootup.validator.util.ValidationResultPrinter} -  Carbon is configured to use the default keystore (wso2carbon.jks). To maximize security when deploying to a production environment, configure a new keystore with a unique password in the production server profile. {org.wso2.carbon.core.bootup.validator.util.ValidationResultPrinter}
TID: [-1] [] [2016-01-13 16:53:03,338]  INFO {org.wso2.carbon.databridge.agent.thrift.AgentHolder} -  Agent created ! {org.wso2.carbon.databridge.agent.thrift.AgentHolder}
TID: [-1] [] [2016-01-13 16:53:03,354]  INFO {org.wso2.carbon.databridge.agent.thrift.internal.AgentDS} -  Successfully deployed Agent Client {org.wso2.carbon.databridge.agent.thrift.internal.AgentDS}
TID: [-1] [] [2016-01-13 16:53:03,713]  WARN {org.wso2.carbon.identity.notification.mgt.NotificationMgtConfigBuilder} -  Secret Resolver is not present. Will not resolve encryptions in config file {org.wso2.carbon.identity.notification.mgt.NotificationMgtConfigBuilder}
TID: [-1234] [] [2016-01-13 16:53:04,619]  INFO {org.wso2.jaggery.scxml.Activator} -  Activating org.wso2.jaggery.scxml with RealmService enabled {org.wso2.jaggery.scxml.Activator}
TID: [-1234] [] [2016-01-13 16:53:08,432] ERROR {org.wso2.carbon.user.core.internal.Activator} -  Cannot start User Manager Core bundle {org.wso2.carbon.user.core.internal.Activator}
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.wso2.carbon.user.core.common.DefaultRealmService.initializeTenantManger(DefaultRealmService.java:327)
    at org.wso2.carbon.user.core.common.DefaultRealmService.<init>(DefaultRealmService.java:90)
    at org.wso2.carbon.user.core.common.DefaultRealmService.<init>(DefaultRealmService.java:109)
    at org.wso2.carbon.user.core.internal.Activator.startDeploy(Activator.java:68)
    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.ArrayIndexOutOfBoundsException: 2
    at org.wso2.carbon.user.core.ldap.LDAPConnectionContext.<init>(LDAPConnectionContext.java:83)
    at org.wso2.carbon.user.core.tenant.CommonHybridLDAPTenantManager.<init>(CommonHybridLDAPTenantManager.java:76)
    ... 24 more

Tried restarting the service and the log file each time has this issue. All LDAP settings have been verified from the ldapadmin tool. We've spent long time investigating this with no change to the error, so any suggestion will be of immense help.

Community
  • 1
  • 1
UKM Dev
  • 21
  • 2
  • Would you edit the two attachments into the question please? We want questions here to be readable even if you subsequently delete your attachments from Google Drive. Code formatting tools are available. Thanks. – halfer Jan 13 '16 at 19:03
  • 1
    @halfer Edited post to include the details. – UKM Dev Jan 14 '16 at 09:24
  • I don't know this tech at alll, but I'd investigate either the `ERROR` or the `Secret Resolver is not present` directly above it. – halfer Jan 14 '16 at 10:49

1 Answers1

0

The problem was fixed by reinstalling the WSO2 product. Apparently the install path had a space in the name

UKM Dev
  • 21
  • 2