gpt4 book ai didi

java - 带有 Active Directory PartialResultException 的 JNDI

转载 作者:太空狗 更新时间:2023-10-29 22:50:08 27 4
gpt4 key购买 nike

我基本上是在 Active Directory 中遍历 LDAP 树。

在每个级别我查询 "(objectClass=*)" .当我在根上执行此操作时,例如 "dc=example,dc=com"我得到下面的异常(exception)。这在我们的其他 LDAP 实例上运行良好。出于某种原因,仅在我们的 Active Directory 服务器上我得到了这个异常。在我们的 Active Directory 服务器上使用 JXplorer 时,我也遇到了同样的异常。

通过在线阅读,我发现有人说你应该打开关注,但不确定那是什么意思...所以在我通过查询传递的控件对象 ( javax.naming.directory.SearchControls ) 上,我调用 searchControls.setDerefLinkFlag(true) .我也试过将它设置为 false结果相同。关于还有什么可能导致这种情况的任何建议?也许我该如何解决?

注意:在这篇文章中,我将 baseDn 从 dc=<my company domain> 更改为以我公司的隐私为例。

javax.naming.PartialResultException: Unprocessed Continuation Reference(s); remaining name 'dc=example,dc=com'
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2820)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2794)
at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1826)
at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1749)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:338)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:321)
at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248)
at com.motio.pi.gui.panels.useraccess.ldap.LDAPConnector.query(LDAPConnector.java:262)
at com.motio.pi.gui.selector.directory.CognosDirectoryBrowserController.expandCognosTreeNode(CognosDirectoryBrowserController.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.motio.pi.utils.PIThreadDelegate$1.run(PIThreadDelegate.java:54)
at java.lang.Thread.run(Thread.java:662)

最佳答案

所以当我使用以下方法创建命名上下文时:

javax.naming.ldap.InitialLdapContext.InitialLdapContext(
Hashtable<?, ?> environment, Control[] connCtls)

在参数 environment 中有一个名为 Context.REFERRAL 的属性,其值应设置为:follow。这是我需要的设置。

关于java - 带有 Active Directory PartialResultException 的 JNDI,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5505351/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com