Spring LdapTemplate org.slf4j.impl.StaticLoggerBinder проблема - PullRequest
0 голосов
/ 23 марта 2020

Я хотел бы создать LdapTemplate:

        LdapContextSource contextSource = new LdapContextSource();
        contextSource.setUrl(ldapUrl);
        contextSource.setUserDn(ldapPrincipal);
        contextSource.setPassword(ldapPassword);
        contextSource.setAuthenticationSource(new BasicAuthenticationSource(ldapPrincipal, ldapPassword));
        contextSource.setReferral(LDAP_REFFERAL);
        contextSource.setCacheEnvironmentProperties(false);
        this.ldapTemplate = new LdapTemplate(contextSource);
        ldapTemplate.setDefaultCountLimit(LDAP_RESULTS_LIMIT);
        ldapTemplate.setDefaultSearchScope(SearchControls.SUBTREE_SCOPE);
        ldapTemplate.setDefaultTimeLimit(LDAP_TIME_LIMIT);

У меня есть зависимость LdapTemplate в pom:

   <dependency>
        <groupId>org.springframework.ldap</groupId>
        <artifactId>spring-ldap-core</artifactId>
        <version>2.3.2.RELEASE</version>
    </dependency>

Проблема в том, что во время вызова LdapContextSource contextSource = new LdapContextSource() возникает проблема slsf4j:

  SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".|#]  SLF4J: Defaulting to no-operation (NOP) logger implementation|#]   SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.|#]

Я вижу, что slf4j-api-1.7.21.jar находится в списке зависимостей

...