legacy-knowledge-base
公開されました Jun. 30, 2025

LDAP データのインポート中にエラーが発生しました:SQLServerException:文字列またはバイナリ・データは切り捨てられます。

written-by

Neil Cuzon

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インポートに失敗しました。DataExceptionによりユーザーを更新できないというエラーが発生し、このエラーはSQLServerExceptionにより発生します。
  • エラーの例は以下を参照:

    ERROR [liferay/scheduled_user_ldap_import-1][LDAPUserImporterImpl:817] Unable to import user CN=Fake Name,OU=STU,OU=UserAccounts,OU=Tier2,OU=FakeCompany: null:null:{samaccountname=sAMAccountName: Fake.Name}

    org.springframework.dao.DataIntegrityViolationException: could not update: [com.liferay.portal.model.impl.UserImpl#9999999]; SQL [update User_ set mvccVersion=?, modifiedDate=?, jobTitle=? where userId=? and mvccVersion=?]; nested exception is org.hibernate.exception.DataException: could not update: [com.liferay.portal.model.impl.UserImpl#9999999]
    (...)
    Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: String or binary data would be truncated.

環境

  • DXP 7.0

解像度

  • この問題は、インポートされるLDAPデータのカラムに、データベースの一致するカラムで許容される文字数を超える文字が含まれているために発生します。
  • この問題を解決するには、 Custom Fields を作成して使用するか、問題のある列の文字数を減らすことができます。
  • 文字数を減らすには、エラーで指定されたCNのデータを見直し、データベース内のすべてのカラムの文字数制限をチェックし、LDAPカラムの内容の文字数と照らし合わせる。
  • データベースの文字数制限を変更すると、アップグレードの際に問題が発生する可能性があります。




did-this-article-resolve-your-issue

legacy-knowledge-base