java - LDAP插入异常

标签 java ldap

我正在尝试向目录服务器数据库添加一个条目。这些是我要插入的值:

userName=[<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e280878ca2858f838b8ecc818d8f" rel="noreferrer noopener nofollow">[email protected]</a>]
driverEmail=[<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1674737856717b777f7a3875797b" rel="noreferrer noopener nofollow">[email protected]</a>]
driverPassword=[ben]
firstName=[Ben]
lastName=[Hur]
newsletter=[false]

我遇到了这个异常:

SEVERE: Cannot create new LDAP entry
LDAPException(resultCode=object class violation, errorMessage='Entry mwUniqueIdentifier=5f9e7597-8a5f-42b0-985b-7d196040689e,ou=People,dc=mobilewarrio
r,dc=com violates the Directory Server schema configuration because it includes     multiple conflicting structural objectclasses inetOrgPerson and mwUser
Account.  Only a single structural objectclass is allowed in an entry')

谁能告诉我这有什么问题吗?

最佳答案

您没有确切地显示您将如何插入这些值,因此很难太具体。然而,异常(exception)情况非常明显。

您尝试为条目分配 inetOrgPerson 对象类和 mwUser 对象类,但这不起作用,因为它们都定义为结构对象类,而且都不是继承自另一个(很可能 mwUser 被定义为结构对象类,因为您的架构未将其指定为 AUXILIARYABSTRACT 对象类)。

RFC 4512 :

An object or alias entry is characterized by precisely one structural object class superclass chain which has a single structural object class as the most subordinate object class.

有两种可能的修复方法,其中应该涉及对 LDAP 架构进行简单的更改:

  1. 如果您希望所有 mwUser 对象都是 inetOrgPerson 对象,只需将 mwUser 声明为 的子对象类inetOrgPerson 像这样(取自 the OpenLDAP documentation ):

    对象类(1.1.2.2.2 NAME 'myPerson' DESC '我的人' SUP inetOrgPerson 必须(myUniqueName $给定名称) 五月我的照片)

在这种情况下,您只需将 mwUser 对象类分配给您的条目。

  • 如果您不希望所有 mwUser 对象都是 inetOrgPerson 对象,则通过指定它是辅助对象类来将其声明为 mixin,如下所示:

    对象类(1.1.2.2.1 NAME 'myPhotoObject' DESC 'mixin myPhoto' 辅助的 五月我的照片)

  • 在这种情况下,您必须将 inetOrgPerson(或另一个结构对象类)以及 mwUser 对象类分配给该对象。

    关于java - LDAP插入异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11417960/

    相关文章:

    java - 正在调用 Servlet 的 service 和 init 方法,但没有调用 doGet

    java - 如何使用已从 Cotainer 放置 JLabel 的方法?

    php - 如何在 Ubuntu 服务器中使用 PHP 7.0 启用 LDAP?

    java - 通过 LDAP 查询 Active Directory 组中的所有用户时,为什么某些用户的 userPassword 属性为空?

    java - 使用 Glassfish 3.1 获取 Active Directory 领域时出错

    ldap - 什么是 LDAP 以及何时考虑在 Web 应用程序中使用它?

    java - Eclipse IDE 边栏(导航)缺失

    Java 如何按降序对有符号整数数组进行排序而忽略符号?

    java - 正则表达式以匹配包含特定单词的所有URL

    java - 通过Java查找嵌套组中的LDAP用户