legacy-knowledge-base
公開されました Jul. 2, 2025

コンマ「,」またはアスタリスク「*」を含む LDAP からユーザー グループをインポートできない

written-by

Dávid Hegedüs

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • コンマ「,」またはアスタリスク「*」を含む LDAP からユーザー グループをインポートしようとすると、次のエラーが表示されます。
2020-06-04 08:23:50.268 WARN [main][LDAPUserImporterImpl:1165] Unable to create user group test,users
2020-06-04 08:23:50.280 ERROR [main][LDAPUserImporterImpl:780] Unable to import group cn=test\,users,ou=groups: null:null:{cn=cn: test,users} java.lang.NullPointerException
 at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.getUsers(LDAPUserImporterImpl.java:720)
 at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importFromLDAPByGroup(LDAPUserImporterImpl.java:763)
 at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importUsers(LDAPUserImporterImpl.java:474)
 at com.liferay.portal.security.ldap.internal.exportimport.LDAPUserImporterImpl.importUsers(LDAPUserImporterImpl.java:415)
...

Environment

  • Liferay ポータル 6.0+
  • Liferay DXP 7.0+
  • LDAP

解像度

  • Liferay のユーザー グループは、名前に「,」および「*」を含めること できません。したがって、LDAP グループに基づいてユーザー グループを追加しようとすると、 com.liferay.portal.kernel.exception.UserGroupNameException が生成されます。 . NullPointerException が発生するのは、後で #getUsers 呼び出されたときに、ユーザー グループとして "null" を受け取るためです。
  • 考えられる回避策は次のとおりです。
    1. importLDAPGroup メソッドで com.liferay.portal.security.ldap.exportimport.LDAPToPortalConverterを実装するカスタム @Component を作成します。
    2. 適切な方法で特殊文字を説明するカスタム ロジックを実装します (たとえば、カンマを削除します)。
    3. したがって、 ldapGroup.getGroupName() が後で
      LDAPUserImporterImpl.importUserGroup(long, Attributes, Properties) で作成されるユーザー グループの名前として使用される場合、失敗せず、ユーザー グループはが作成されます。

追加情報

  • この リンクでデフォルトの実装を見つけてください。

did-this-article-resolve-your-issue

legacy-knowledge-base