Announcement Announcement Module
Collapse
No announcement yet.
LDAP multiple Urls fail safe connection Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • LDAP multiple Urls fail safe connection

    I've been reading :
    http://forum.springframework.org/sho...ight=switching

    When one of the LDAP server does not respond anymore, there are connection failure even if the other server was fine.

    org.springframework.ldap.ServiceUnavailableExcepti on: server1:1389; socket closed; nested exception is javax.naming.ServiceUnavailableException: server1:1389; socket closed; remaining name ''
    Caused by: javax.naming.ServiceUnavailableException: localhost:1389; socket closed;

    What should be done in order that the API tries also the other server connection before saying that the service is unavailable?

    Removing the pool is the only solution?

    By the way, when the urls property is used, the base property is not used for the first server.
    The solution is to use the urls property with the base name "ldap://server1:1389/basevalue ldap://server2:1389/baseValue" and not setting the base property on the LdapContextSource.

  • #2
    Well, this is pretty much out of our hands. The multiple URL handling takes place deep down in the LDAP Provider code, so there's nothing we can do about it. In the upcoming version of Spring LDAP (due this week) we will however include a new pooling library that will among other things include connection validation. That would probably help you out here.

    With regards to the base path and multiple connections I would like to have that confirmed. If it is verifiable that this is handled incorrectly I'd like to ask you to file a jira issue with the details.

    Comment


    • #3
      Originally posted by rasky View Post
      With regards to the base path and multiple connections I would like to have that confirmed. If it is verifiable that this is handled incorrectly I'd like to ask you to file a jira issue with the details.
      I've been retrying. This happens when using a space instead of a comma or lists in the "urls" property of the LdapContextSource. It is then the consequence of a improper usage of the urls property.
      http://static.springframework.org/sp...ir-context-url
      The doc states :
      It is possible to configure multiple alternate LDAP servers using the urls property. In this case, supply all server urls in a String array to the urls property.

      Comment


      • #4
        Originally posted by pedro_cristian View Post
        I've been retrying. This happens when using a space instead of a comma or lists in the "urls" property of the LdapContextSource. It is then the consequence of a improper usage of the urls property.
        http://static.springframework.org/sp...ir-context-url
        The doc states :
        It is possible to configure multiple alternate LDAP servers using the urls property. In this case, supply all server urls in a String array to the urls property.

        Pedro are you saying that setUrls(String[]) works fine?

        In the provided string array I trim all the strings and remove any comma. This is the approach I am doing but we haven't conducted the fail over tests yet.

        Comment


        • #5
          Originally posted by davsclaus View Post
          Pedro are you saying that setUrls(String[]) works fine?

          In the provided string array I trim all the strings and remove any comma. This is the approach I am doing but we haven't conducted the fail over tests yet.
          At least the urls attribute is set appropriately in the ldap template.
          We are evaluating the Spring LDAP framework. the simplicity of usage is nice, but the fail over with multiple urls produces notable waiting times (up to 20 seconds) when one of the server is down.
          Last edited by pedro_cristian; Dec 5th, 2007, 05:29 AM.

          Comment


          • #6
            Originally posted by pedro_cristian View Post
            At least the urls attribute is set appropriately in the ldap template.
            We are evaluating the Spring LDAP framework. the simplicity of usage is nice, but the fail over with multiple urls produces notable waiting times (up to 20 seconds) when one of the server is down.
            Once again, if you use Java for LDAP communication this will not change regardless of whether you're using Spring LDAP or not. It's just the way the failover works in the Java LDAP Provider.

            Comment

            Working...
            X