MaxResultsExceededException occurs during LDAP repository search
Follow the steps listed here to troubleshoot when a MaxResultsExceededException occurs.
Problem
The following or similar MaxResultsExceededException occurs when retrieving search results from the LDAP server:
com.ibm.websphere.wim.exception.MaxResultsExceededException:
CWWIM1018E search results exceeds the 4500 maximum search limit.
This exception is thrown when the number of entries in the search results retrieved from the LDAP server exceeds the value of the maxSearchResults parameter specified in wimconfig.xml file.
Solution
When your application calls the virtual member manager search() method, use the countLimit parameter to pass a value to truncate search results when that value is reached. In the following sample data graph, the countLimit is set to 4, which means that the results are truncated when 4 entries are retrieved from the LDAP server.
<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>
If the countLimit parameter is not set when your application calls the search() method, then all entries are retrieved from the LDAP server. If the number of entries retrieved from the LDAP server exceeds the maxSearchResults value, the MaxResultsExceededException occurs.
To ensure that this exception is not thrown, set the value of countLimit to be less than the value of maxSearchResults.
- maxSearchResults="110000"
- searchTimeOut="600000"
- searchCountLimit="500"
- searchTimeLimit="120000"
You cannot set the value of maxSearchResults using the administrative console or command line interface. You can set it manually by editing the wimconfig.xml file. The default value is 4500.
Related topics
IdMgrRepositoryConfig command group for the AdminTask object