Hi Brandon, I was never able to get it to work and resorted to not using the ldaptemplate for authenticating users. I tried a lot to resolve this but it never works. there is something preventing the class loading to work correctly but I couldn't figure it out.
Matt On Wed, Jul 23, 2014 at 9:59 AM, Brandon G <[email protected]> wrote: > > > > Matt Wendling <mwendling@...> writes: > > > > > Using the Spring LDAP template I'm getting a class cast exception: > > > > Caused by: java.lang.ClassCastException: com.sun.jndi.ldap.LdapCtx cannot > > be cast to org.springframework.ldap.core.DirContextOperations > > > Matt, > > I just ran into this this morning. Exact same problem. > Have you made headway on it? > > I'm trying to write a module to talk to an LDAP, using Spring-LDAP. > I have deployed spring-ldap by placing > spring-ldap-core-2.0.1.RELEASE into the deploy folder. > > When I deploy my app it hits this: > > String sn = template.searchForObject(queryToUse, > new AbstractContextMapper<String>() { > > @Override > protected String doMapFromContext(DirContextOperations ctx) { > > And blows up with this: > > ClassCastException: com.sun.jndi.ldap.LdapCtx cannot be cast to > org.springframework.ldap.core.DirContextOperations > > Doing a bundle:tree_show on my bundle reveals a whole bunch of > org.apache.servicemix dependencies that I did not declare so I'm > guessing the dynamic-import feature of Karaf sucked those in. > > But I'm an OSGI/Karaf noob and not sure exactly how to proceed. > > Any hints would be appreciated, > Brandon > > > > >
