Results 1 to 5 of 5

Thread: Issue with DefaultDirContextValidator and search scope

  1. #1
    Join Date
    Jul 2008
    Posts
    7

    Default Issue with DefaultDirContextValidator and search scope

    I did a quick search, but didn't see this mentioned...

    I found a small issue with org.springframework.ldap.pool.validation.DefaultDi rContextValidator that will result in validateDirContext() failing for many/most LDAP implementations. The cause is that the root context search is being attempted with a search scope of SearchControls.ONELEVEL_SCOPE, the default scope when the scope isn't specified. This may succeed for some LDAP implementations (I think it should for Domino), but will fail for e.g., Active Directory and SunONE.

    The fix is to add
    Code:
    this.searchControls.setSearchScope(SearchControls.OBJECT_SCOPE);
    to the constructor. Already done in our DirContextValidator that's based on DefaultDirContextValidator, but changing the 'example code' might save someone a little frustration.

  2. #2
    Join Date
    Jul 2005
    Location
    Helsingborg, Sweden
    Posts
    504

    Default

    You're right, the default scope is ONELEVEL and a root DSE query with that surely fails on some servers. We're missing an integration test here. Good catch.

    Could you be so kind and create a JIRA issue about this?
    Ulrik Sandberg
    Jayway (www.jayway.com)
    Spring LDAP project member

  3. #3
    Join Date
    Jul 2008
    Posts
    7

    Default

    Thanks, and done: LDAP-121 in Jira.

  4. #4
    Join Date
    Jan 2010
    Posts
    2

    Default

    Do you know if this is fixed yet. I am getting an intermittent error as follows, which may be related. "Failed to borrow DirContext from pool.; nested exception is java.util.NoSuchElementException: Could not create a validated object"

  5. #5
    Join Date
    Apr 2008
    Posts
    15

    Default

    Quote Originally Posted by r.chick View Post
    Do you know if this is fixed yet. I am getting an intermittent error as follows, which may be related. "Failed to borrow DirContext from pool.; nested exception is java.util.NoSuchElementException: Could not create a validated object"
    More than a year later, I am getting the same issue. Has anyone had any luck with this error? My google searches are not revealing anything helpful so far.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •