gs-authenticating-ldap: Embedded ldap connention refused

Hi Do i need any additional configuration to setup embedded ldap, I have following dependency in my pom.xml

<dependency>
            <groupId>org.springframework.ldap</groupId>
            <artifactId>spring-ldap-core</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-ldap</artifactId>
        </dependency>
        <dependency>
            <groupId>com.unboundid</groupId>
            <artifactId>unboundid-ldapsdk</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <scope>test</scope>
        </dependency>

Also in application properties file

spring.ldap.embedded.ldif=classpath:test-data.ldif
spring.ldap.embedded.base-dn=ou=users,dc=cluster,dc=local
spring.ldap.embedded.port=8389
spring.ldap.embedded.url=ldap://localhost:8389/

But while running test i am getting connection refused.

org.springframework.ldap.CommunicationException: localhost:8389; nested exception is javax.naming.CommunicationException: localhost:8389 [Root exception is java.net.ConnectException: Connection refused]

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Reactions: 3
  • Comments: 18

Most upvoted comments

Works for me with additional changes as below:

application.properties spring.ldap.embedded.base-dn=dc=springframework,dc=org spring.ldap.embedded.ldif=classpath:test-server.ldif spring.ldap.embedded.port=8389 spring.ldap.embedded.url=ldap://localhost:8389/

add in application.properties

spring.ldap.embedded.ldif=classpath:test-server.ldif
spring.ldap.embedded.base-dn=dc=springframework,dc=org
spring.ldap.embedded.port=8389

I noticed in the guide that the @EnableWebSecurity annotation was missing from WebSecurityConfig.java. Maybe this is your issue.

Worked for me after adding compile("org.springframework:spring-tx") compile("com.unboundid:unboundid-ldapsdk") to the build.gradle file

Works for me with additional changes as below:

application.properties spring.ldap.embedded.base-dn=dc=springframework,dc=org spring.ldap.embedded.ldif=classpath:test-server.ldif spring.ldap.embedded.port=8389 spring.ldap.embedded.url=ldap://localhost:8389/

@michaellow thanks for sharing, worked for me as well with this configuration

I am having the same issue.