LDAP 存储库搜索期间发生 MaxResultsExceededException

发生 MaxResultsExceededException 时遵循此处列出的步骤进行故障诊断。

问题

从 LDAP 服务器检索搜索结果时发生以下或相似 MaxResultsExceededException。

com.ibm.websphere.wim.exception.MaxResultsExceededException: 
CWWIM1018E search results exceeds the 4500 maximum search limit. 

从 LDAP 服务器检索的搜索结果中的条目数量超出 wimconfig.xml 文件中指定的 maxSearchResults 参数的值时,抛出此异常。

解决方案

应用程序调用 virtual member manager search() 方法时,使用 countLimit 参数以传递值,从而在搜索此值时截断搜索结果。 在以下样本数据图中,countLimit 设置为 4,这表示从 LDAP 服务器检索 4 个条目时会截断结果。

<sdo:datagraph xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:sdo="commonj.sdo" xmlns:wim="http://www.ibm.com/websphere/wim">
  <wim:Root>
    <wim:controls xsi:type="wim:SearchControl" countLimit="4" expression="//entities[@xsi:type='PersonAccount' and uid='*']">
      <wim:properties>uid</wim:properties>
      <wim:properties>cn</wim:properties>
      <wim:properties>sn</wim:properties>
      <wim:properties>mail</wim:properties>
    </wim:controls>
  </wim:Root>
</sdo:datagraph>

如果应用程序调用 search() 方法时没有设置 countLimit 参数,那么可从 LDAP 服务器检索所有条目。如果从 LDAP 服务器检索的条目数量超出 rmaxSearchResults 值,会发生 MaxResultsExceededException。

要确保没有抛出此异常,请将 countLimit 的值设置为小于 maxSearchResults 的值。

注: maxSearchResults 和 searchTimeOut 属性对 search() 方法指定的搜索设置限制。SearchCountLimit 和 searchTimeLimit 属性对 LDAP 存储库中的组、祖代或后代搜索设置限制。
以下为这些属性的样本值:
  • maxSearchResults=”110000”
  • searchTimeOut=”600000”
  • searchCountLimit=”500”
  • searchTimeLimit”120000”

无法使用管理控制台或命令行界面设置 maxSearchResults 的值。可通过编辑 wimconfig.xml 文件手动对其进行设置。缺省值是 4500。

相关主题

SearchControl DataObject

轻量级目录访问协议性能设置

IdMgrRepositoryConfig 命令组(针对 AdminTask 对象)



使用条款 | 反馈