Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-5427

ClassCastException: org.wildfly.extension.elytron.LdapKeyStoreService incompatible with org.wildfly.extension.elytron.KeyStoreService while executing CLI command

    XMLWordPrintable

Details

    Description

      The following commands result in a ClassCastException:

      /subsystem=elytron/dir-context=ldapDirContext-LdapKeyStoreTestCase:add(url=ldap://localhost:10389, principal="uid=admin,ou=system", credential-reference={clear-text => secret})
      
      /subsystem=elytron/ldap-key-store=ldapKeyStore-LdapKeyStoreTestCase:add(dir-context=ldapDirContext-LdapKeyStoreTestCase, search-path="ou=Keystore,o=LdapKeyStoreTestCase8d061d47,o=primary,dc=jboss,dc=org", filter-alias="(&(objectClass=inetOrgPerson)(cn={0}))", filter-certificate="(&(objectClass=inetOrgPerson)(usercertificate={0}))", filter-iterate="(objectClass=inetOrgPerson)")
      
      /subsystem=elytron/key-manager=keyManager-LdapKeyStoreTestCase:add(key-store=ldapKeyStore-LdapKeyStoreTestCase, credential-reference={clear-text => Elytron}, algorithm=SunX509)
      

      The following exception is then thrown:

      23:50:28,536 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-7) MSC000001: Failed to start service org.wildfly.security.key-manager.keyManager-LdapKeyStoreTestCase: org.jboss.msc.service.StartException in service org.wildfly.security.key-manager.keyManager-LdapKeyStoreTestCase: Failed to start service
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
      	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
      	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.ClassCastException: org.wildfly.extension.elytron.LdapKeyStoreService cannot be cast to org.wildfly.extension.elytron.KeyStoreService
      	at org.wildfly.extension.elytron.SSLDefinitions$1.lambda$getValueSupplier$0(SSLDefinitions.java:594)
      	at org.wildfly.extension.elytron.TrivialService.start(TrivialService.java:53)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
      	... 6 more
      
      23:50:28,540 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 2) WFLYCTL0013: Operation ("add") failed - address: ([
          ("subsystem" => "elytron"),
          ("key-manager" => "keyManager-LdapKeyStoreTestCase")
      ]) - failure description: {"WFLYCTL0080: Failed services" => {"org.wildfly.security.key-manager.keyManager-LdapKeyStoreTestCase" => "Failed to start service
          Caused by: java.lang.ClassCastException: org.wildfly.extension.elytron.LdapKeyStoreService cannot be cast to org.wildfly.extension.elytron.KeyStoreService"}}

      This was introduced with the changes for WFCORE-5095:

      https://github.com/wildfly/wildfly-core/blame/15.x/elytron/src/main/java/org/wildfly/extension/elytron/SSLDefinitions.java#L594

      Attachments

        Issue Links

          Activity

            People

              fjuma1@redhat.com Farah Juma
              fjuma1@redhat.com Farah Juma
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: