New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ClassNotFoundException in JNDI provider is thrown when custom ssl socket factory is used #99

Closed
floragunncom opened this Issue May 28, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@floragunncom
Copy link
Contributor

floragunncom commented May 28, 2016

new InitialLdapContext() in JndiConnectionFactory.createInternal can throw a ClassNotFoundException when java.naming.ldap.factory.socket is set and the context classloader of the current thread does not "know" the class. For details refer to http://docs.oracle.com/javase/jndi/tutorial/beyond/misc/classloader.html and http://www.javaworld.com/article/2077344/core-java/find-a-way-out-of-the-classloader-maze.html

PR to fix this: #98

@dfish3r

This comment has been minimized.

Copy link
Member

dfish3r commented May 31, 2016

Under what circumstances have you seen this exception occur?

@floragunncom

This comment has been minimized.

Copy link
Contributor

floragunncom commented Jun 1, 2016

Every time the context classloader is one which is not aware of the ThreadLocalTLSSocketFactory.class.
We faced this issue in our elasticsearch plugin where we use ldaptive as a library. As a plugin provider we have no direct control over classloaders.

For us this is a showstopper. Currently we use a forked version of ldaptive with the PR applied but thats not a long term solution. I'd really like to see the PR merged and released. ldaptive is really a great library but it's been a while since the last release. Thx.

dfish3r added a commit that referenced this issue Jun 2, 2016

Add classLoader property to JndiProviderConfig.
Update Jndi connection factories to use a custom class loader if provided.
See #99.
@dfish3r

This comment has been minimized.

Copy link
Member

dfish3r commented Jun 8, 2016

@floragunncom can you confirm that latest master resolves your issue?

@dfish3r

This comment has been minimized.

Copy link
Member

dfish3r commented Jun 16, 2016

No response from reporter. Assume #100 fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment