Git Product home page Git Product logo

spring-data-ldap's Issues

1.0 RC1 (Ingalls) Backported Issues

  • Adapt API in RepositoryFactoryBeanSupport implementation #26
  • Upgrade to Spring LDAP 2.2.0 GA #31
  • Upgrade to a newer JDK version on TravisCI #32
  • Add build profile for next Spring LDAP version #35
  • Upgrade to Spring LDAP 2.3 RC1 #36

Spring Data Example Tests fail with NoClassDefFoundError: LdapContextSource [DATALDAP-38]

Jens Schauder opened DATALDAP-38 and commented

The LDAP example fails when run with JDK9 without the --permit-illegal-access flag.

java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ldapContextSource' defined in class path resource [org/springframework/boot/autoconfigure/ldap/embedded/EmbeddedLdapAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ldap.core.ContextSource]: Factory method 'ldapContextSource' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.springframework.ldap.core.support.LdapContextSource
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.ldap.core.ContextSource]: Factory method 'ldapContextSource' threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.springframework.ldap.core.support.LdapContextSource
Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.springframework.ldap.core.support.LdapContextSource

Issue Links:

Ldap Repository can not be created using latest Spring Boot 2.0 with Spring Framework 5.0 [DATALDAP-13]

Guan Wang opened DATALDAP-13 and commented

My code stopped working since 2 days ago and I submitted this at Spring Boot:
spring-projects/spring-boot#7670

It seems this issue has been solved. However, I still have issue to make my code working: If I put @EnableLapRepositories on a class with a @Bean for ldapTemplate to enable a LDAP Repository, Spring complains the following:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userRepository': Could not resolve matching constructor (hint: specify index/type/name arguments for simple parameters to avoid type ambiguities)

My guess is that userRepository needs a ldapTemplate bean, which is not available at this moment.

I am not sure if I made a classic "amateur" mistake or this has something to do with the recent upgrade to SPF 5.0


Affects: 1.0 RC1 (Ingalls)

Create ability to do string replacements on base= @Query in interfaces [DATALDAP-22]

Brett Maxfield opened DATALDAP-22 and commented

It would be nice to be able to replace parameters in base dn of a custom @Query

For example, you can do this as of 1.0.0 (using default SimpleLdapRepository) :

@Query(value="(mail={0})", searchScope=SearchScope.SUBTREE, base="o=hosting,dc=example,dc=com")
MailAccount findByMail(String mail);

The {0} is replaced with the 0'th parameter on the interface, tokens repalced by the spring QueryBuilder

But something you cannot do (so it's a theoretical example, of scope single) :

@Query(value="(mail={0})", searchScope=SearchScope.ONELEVEL, base="jvd={1},o=hosting,dc=example,dc=com")
MailAccount findByDomain(String mail, String domain);

The intent would be to expands the placeholder(s) in the base= field in the annotation, with the numbered argument, and do a search in the requested scope, using the search filter with the replaced parameters. Alternatively (perhaps in addition) using the named @Param annotation, as used by spring-data-jpa

In this case there is a LDAP structure like :

o=hosting
jvd=domain1
mail=somebody@domain1
jvd=domain2
...

The first query is valid, and it works, as it has a subtree scope, and it so happens the mail=* entries under the jvd=domain structure are also unique when queried from o=hosting scope, but it is only a happy accident. In my application i do a findAll() with an LdapQuery incl., a crafted base, this was pushed up to the business objects implementations, a bit messy.

A per-domain search in this application should search in that subtree only. The standard @DnAttribute paradigm is too inflexible for this, as the domain does not stand by itself in any ldap field, that can be mapped to a bean field (without custom logic to split the mail).

If there were (uid=x) entries, which are only valid if searched within the jvd=domain structure, then this would not be appropriate. The (jvd=x) structures are managed by separate organizations, it is a standard structure for virtual mailbox applications


Affects: 1.0 GA (Ingalls)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.