我们使用 JDK 1.8.0_65 将 WSO2 Governance Registry 5.1.0 设置为 Windows 服务。本地设置工作正常,但现在我们希望它使用只读 LDAP 连接到 AD。遵循网站上的文档以及大量博客文章和 Stack Overflow 问题,但似乎没有一个答案有效。
<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>
日志文件
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
尝试重新启动服务和日志文件每次都有这个问题。所有 LDAP 设置均已通过 ldapadmin 工具进行验证。我们已经花了很长时间调查这个问题,但没有改变错误,所以任何建议都会有很大帮助。