首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Spring ldaptemplate更新组存在大量成员问题

Spring ldaptemplate更新组存在大量成员问题
EN

Stack Overflow用户
提问于 2017-09-21 09:22:20
回答 1查看 564关注 0票数 0

我在Active Directory中更新成员超过1500人的组时遇到问题。它只是尝试修改成员属性。

我更新成员较少的组时没有任何问题。我也可以添加一个有很多成员的新群。

但是,如果它太大,更新就会失败。我可以尝试将大组更新为只有一个成员,但仍然失败,并显示相同的错误。

modifyAttributes行上的代码失败:

代码语言:javascript
运行
复制
ModificationItem[] modList = 
nameContext.getDirContextAdapter().getModificationItems();

writeADTemplate.modifyAttributes(nameContext.getName(),modList);

下面的StackTrace:

代码语言:javascript
运行
复制
org.springframework.ldap.NameAlreadyBoundException: [LDAP: error code 68 - 
00000562: UpdErr: DSID-031A122A, problem 6005 (ENTRY_EXISTS), data 0
nested exception is javax.naming.NameAlreadyBoundException: [LDAP: error 
code 68 - 00000562: UpdErr: DSID-031A122A, problem 6005 (ENTRY_EXISTS), data 0
remaining name 'cn=Atlassian Users,ou=Groups'
at org.springframework.ldap.support.LdapUtils.convertLdapException
(LdapUtils.java:169)
at org.springframework.ldap.core.LdapTemplate.executeWithContext
(LdapTemplate.java:810)
at 
org.springframework.ldap.core.LdapTemplate.executeReadWrite 
(LdapTemplate.java:802)
at org.springframework.ldap.core.LdapTemplate.modifyAttributes
 (LdapTemplate.java:967)
 more ... 
Caused by: javax.naming.NameAlreadyBoundException: [LDAP: error code 68 - 
00000562: UpdErr: DSID-031A122A, problem 6005 (ENTRY_EXISTS), data 0
remaining name 'cn=Atlassian Users,ou=Groups'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(Unknown Source)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_modifyAttributes(Unknown 
Source)
at 
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(Unknown 
Source)
at javax.naming.directory.InitialDirContext.modifyAttributes(Unknown Source)
at 
org.springframework.ldap.core.LdapTemplate$19.executeWithContext 
(LdapTemplate.java:969)
at 
org.springframework.ldap.core.LdapTemplate.executeWithContext 
(LdapTemplate.java:807)
... 88 more
EN

回答 1

Stack Overflow用户

发布于 2017-09-22 01:10:03

好的,我真正的问题是,如果值大于1500,Active Directory将不会返回成员这样的多值属性。当我获取当前组成员时,它返回0值,所以我的代码试图将所有成员添加回组中。

看起来我必须弄清楚如何使用DefaultIncrementalAttributesMapper来获得所有的成员

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46333943

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档