Hi,
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
at
org.springframework.ldap.core.LdapEntryIdentificationContextMapper.mapFromContext(LdapEntryIdentificationContextMapper.java:28)
at
org.springframework.ldap.core.ContextMapperCallbackHandler.getObjectFromNameClassPair(ContextMapperCallbackHandler.java:67)
at
org.springframework.ldap.core.CollectingNameClassPairCallbackHandler.handleNameClassPair(CollectingNameClassPairCallbackHandler.java:50)
The issue seems to be caused by the com.sun.jndi.ldap.InitialCtxFactory not
being loaded in the same class loader as the rest of my module that is
invoking the ldap request.
I've tried adding the packages to every import-package and also tried
adding them to the org.osgi.framework.bootdelegation
and org.osgi.framework.system.packages.extra properties as well. Still I
always get the class cast exception.
I also tried this in SMX 5.1.0 with same results.
Does anyone know how to make this work? Is there a workaround?
Matt