dcsimg
How to get all Object Classes
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Frank_yu
Posted On:   Tuesday, June 27, 2006 04:47 PM

I used the search method to get all object classes in the tree rooted at the base domain. The problem is that SizeLimitExceededException occurred. I would like to know exactly what cause the SizeLimitExceededException to occur, so that I can avoid the SizeLimitExceededException while making the code to work. Here is the piece of code: String[] attributesToReturn = {"objectclass"}; String filter = "(objectclass=*)"; SearchControls cons = new SearchControls(); cons.setSearchScope(SearchControls.SUBTREE_SCOPE); cons.setReturningAttributes(attributesToReturn); debug("Count Limit: " + cons.getCountLimit()); NamingEnumera   More>>

I used the search method to get all object classes in the tree rooted at the base domain. The problem is that SizeLimitExceededException occurred. I would like to know exactly what cause the SizeLimitExceededException to occur, so that I can avoid the SizeLimitExceededException while making the code to work.


Here is the piece of code:



String[] attributesToReturn = {"objectclass"};
String filter = "(objectclass=*)";
SearchControls cons = new SearchControls();
cons.setSearchScope(SearchControls.SUBTREE_SCOPE);
cons.setReturningAttributes(attributesToReturn);
debug("Count Limit: " + cons.getCountLimit());

NamingEnumeration answer = context.search(name, filter, cons);
Vector objectClasses = process(answer);
print(objectClasses);


Here is the exception:


javax.naming.SizeLimitExceededException: [LDAP: error code 4 - Sizelimit Exceeded]; remaining name ''
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3057)

   <<Less

Re: How to get all Object Classes

Posted By:   WarnerJan_Veldhuis  
Posted On:   Wednesday, June 28, 2006 01:43 AM

You query returns too much objects. That could be a server-set limit.
About | Sitemap | Contact