Custom Elytron Security Realm LDAP issue on EAP 7.4
Issue
When a standalone application tries to connect and authenticate to a server that is part of a domain so it can call business logic in the EJB container, our custom Elytron realm gets a classpath error when it tries to connect to our LDAP server.
The realm does not have any problem authenticating web application users, and this does not happen with our standalone development system. It only happens when we deploy everything to our domain.
This is the error we see in the log when a standalone client tries to authenticate:
javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module "org.wildfly.extension.io" version 15.0.8.Final-redhat-00001 from local module loader @2002348 (finder: local module finder @5911e990 (roots: /opt/jboss-eap-7.4/modules,/opt/jboss-eap-7.4/modules/system/layers/base/.overlays/layer-base-jboss-eap-7.4.4.CP,/opt/jboss-eap-7.4/modules/system/layers/base)) [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory from [Module "org.wildfly.extension.io" version 15.0.8.Final-redhat-00001 from local module loader @2002348 (finder: local module finder @5911e990 (roots: /opt/jboss-eap-7.4/modules,/opt/jboss-eap-7.4/modules/system/layers/base/.overlays/layer-base-jboss-eap-7.4.4.CP,/opt/jboss-eap-7.4/modules/system/layers/base))]]
(...)
Environment
Red Hat JBoss Enterprise Application Platform (EAP) - 7.4.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.