Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-7278

Unable to load LdapCtxFactory from elytron module

    XMLWordPrintable

Details

    • Hide
      /subsystem=elytron/dir-context=DC1:add(url="ldap://localhost:10389/", authentication-level=none)
      /subsystem=elytron/ldap-key-store=LKS1/:add(dir-context=DC1, search-path="ou=keystore,dc=elytron,dc=wildfly,dc=org")
      /subsystem=elytron/trust-managers=MyTrustManager/:add(algorithm=SunX509, key-store=LKS1)
      
      /subsystem=elytron/dir-context=DC1:add(url="ldap://localhost:10389/", authentication-level=none)
      /subsystem=elytron/ldap-key-store=LKS1/:add(dir-context=DC2,search-path="ou=keystore,dc=example,dc=com",search-recursive=true)
      /subsystem=elytron/ldap-key-store=LKS1:remove
      
      Show
      /subsystem=elytron/dir-context=DC1:add(url= "ldap: //localhost:10389/" , authentication-level=none) /subsystem=elytron/ldap-key-store=LKS1/:add(dir-context=DC1, search-path= "ou=keystore,dc=elytron,dc=wildfly,dc=org" ) /subsystem=elytron/trust-managers=MyTrustManager/:add(algorithm=SunX509, key-store=LKS1) /subsystem=elytron/dir-context=DC1:add(url= "ldap: //localhost:10389/" , authentication-level=none) /subsystem=elytron/ldap-key-store=LKS1/:add(dir-context=DC2,search-path= "ou=keystore,dc=example,dc=com" ,search-recursive= true ) /subsystem=elytron/ldap-key-store=LKS1:remove

    Description

      When ldap-key-store is used in trust-manager, trust-manager creation fails:

      Caused by: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module "org.wildfly.extension.elytron:main" from local module loader @77a57272 (finder: local module finder @7181ae3f (roots: /home/jkalina/wildfly/wildfly/build/target/wildfly-11.0.0.Alpha1-SNAPSHOT/modules,/home/jkalina/wildfly/wildfly/build/target/wildfly-11.0.0.Alpha1-SNAPSHOT/modules/system/layers/base)) [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory from [Module "org.wildfly.extension.elytron:main" from local module loader @77a57272 (finder: local module finder @7181ae3f (roots: /home/jkalina/wildfly/wildfly/build/target/wildfly-11.0.0.Alpha1-SNAPSHOT/modules,/home/jkalina/wildfly/wildfly/build/target/wildfly-11.0.0.Alpha1-SNAPSHOT/modules/system/layers/base))]]
      	at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:118)
      	at org.jboss.as.naming.InitialContext.init(InitialContext.java:99)
      	at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154)
      	at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:89)
      	at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:43)
      	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
      	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
      	at javax.naming.InitialContext.init(InitialContext.java:244)
      	at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154)
      	at org.wildfly.security.auth.realm.ldap.SimpleDirContextFactoryBuilder$SimpleDirContextFactory.createDirContext(SimpleDirContextFactoryBuilder.java:286)
      	at org.wildfly.security.auth.realm.ldap.SimpleDirContextFactoryBuilder$SimpleDirContextFactory.obtainDirContext(SimpleDirContextFactoryBuilder.java:222)
      	at org.wildfly.extension.elytron.DirContextDefinition.lambda$null$0(DirContextDefinition.java:148)
      	at org.wildfly.security.keystore.LdapKeyStoreSpi.obtainDirContext(LdapKeyStoreSpi.java:120)
      	... 16 more
      java.lang.ClassNotFoundException: com.sun.jndi.ldap.LdapCtxFactory from [Module "org.wildfly.extension.elytron:main" from local module loader @77a57272 (finder: local module finder @7181ae3f (roots: /home/jkalina/wildfly/wildfly/build/target/wildfly-11.0.0.Alpha1-SNAPSHOT/modules,/home/jkalina/wildfly/wildfly/build/target/wildfly-11.0.0.Alpha1-SNAPSHOT/modules/system/layers/base))]
      	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:199)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:364)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:352)
      	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:94)
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:348)
      	at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:113)
      	... 28 more
      

      Direct key-store aliases listing using works ok:

      /subsystem=elytron/ldap-key-store=LKS1/:read-children-names(child-type=alias)
      

      Attachments

        Issue Links

          Activity

            People

              jkalina@redhat.com Jan Kalina (Inactive)
              jkalina@redhat.com Jan Kalina (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: