2016-03-01 16:24:23 [ERROR] com.coremedia.ldap.LdapUserProvider - Exception while serving com.coremedia.ldap.ad.ActiveDirectoryUserProvider#getUsers: java.util.Vector cannot be cast to java.lang.String
java.lang.ClassCastException: java.util.Vector cannot be cast to java.lang.String
at com.sun.jndi.ldap.LdapReferralException.getNextReferral(LdapReferralException.java:241) ~[na:1.8.0_65]
at com.sun.jndi.ldap.LdapReferralException.skipReferral(LdapReferralException.java:201) ~[na:1.8.0_65]
at com.coremedia.ldap.impl.LdapConnector.ldapSearch(LdapConnector.java:335) ~[coremedia-ldap-7.1.11-5.jar:7.1.11-5]
Handle LDAP Referral Exceptions in Java 8
Last updated 2 months ago
Learn how to cope with a bug in Java 8
What you'll learn
- Know about the Java 9 LDAP bug
Prerequisites
- LDAP Integration
Time matters
Reading time: 5 minutes
Should I read this?
This guide is for Developers.
Table of Contents
Due to a bug in the JNDI implementation in Java 8 the CoreMedia LDAP integration cannot correctly cope with referrals.
The problem shows in exceptions like this:
Workaround for com.coremedia.ldap.basedns
If you use Active Directory with trust relationships, you can only use DNs underneath the DC level in com.coremedia.ldap.basedns
.
For instance, it crashes with the following settings:
DC=example,DC=org
But it works with:
CN=Users,DC=example,DC=org
To define more than one base distinguished name (DN) just list them semicolon separated:
com.coremedia.ldap.basedns=CN=Users,DC=example,DC=org;CN=Users,DC=com,DC=de
Is this page useful?