Announcement Announcement Module
Collapse
No announcement yet.
Basic search problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Basic search problem

    Hello,
    I have the following code:
    Code:
    DistinguishedName name = new DistinguishedName("DC=extranet,DC=cap");
    name.add("ou", "test");
    
    List l = ldapTemplate.search(name.encode(),  "objectClass=*", SearchControls.SUBTREE_SCOPE, new AttributesMapper() {
    public Object mapFromAttributes(Attributes attrs) throws NamingException {
    						
    	return attrs.get("cn").get();
    }
    }
    );
    System.out.println("!!!!!!!!!!!!!!!!!!>" + l.size());
    ...
    The List size is alway 0. I have tried different approaches but with no luck.
    The LDAP server (MS AD) returns the correct reply if I use any kind of ldap browser.

    Any idea?
    Thanks
    Luciano

  • #2
    Have you specified a base path in the ContextSource setup? In that case it should not be included in the search base.

    Comment

    Working...
    X