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

Configuring security realm throws NullPointerException when operational header allow-resource-service-restart is used

    XMLWordPrintable

Details

    Description

      Josef Cacek reports:

      Several methods in the SecurityRealmAddHandler class don't handle null value of List<ServiceController<?>> newControllers (c.f. SecurityRealmParentRestartHandler.recreateParentService), and therefor they fail when allow-resource-service-restart==true.

      For instance if you run following commands using console:

      [standalone@localhost:9999 /] /core-service=management/security-realm=JBossTest:add

      {"outcome" => "success"}

      [standalone@localhost:9999 /] /core-service=management/security-realm=JBossTest/authentication=local:add(allowed-users="*", default-user="$local")

      {allow-resource-service-restart=true}

      {
      "outcome" => "failed",
      "failure-description" => "JBAS014749: Operation handler failed: null",
      "rolled-back" => true
      }

      Throws NPE in the server:

      12:17:21,839 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 6) JBAS014612: Operation ("add") failed - address: ([
      ("core-service" => "management"),
      ("security-realm" => "test"),
      ("authentication" => "local")
      ]): java.lang.NullPointerException
      at org.jboss.as.domain.management.security.SecurityRealmAddHandler.addLocalService(SecurityRealmAddHandler.java:275) [jboss-as-domain-management-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
      at org.jboss.as.domain.management.security.SecurityRealmAddHandler.installServices(SecurityRealmAddHandler.java:133) [jboss-as-domain-management-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
      at org.jboss.as.domain.management.security.SecurityRealmParentRestartHandler.recreateParentService(SecurityRealmParentRestartHandler.java:64) [jboss-as-domain-management-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
      at org.jboss.as.controller.RestartParentResourceHandlerBase$1.execute(RestartParentResourceHandlerBase.java:73) [jboss-as-controller-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
      at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:440) [jboss-as-controller-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
      ...

      Attachments

        Activity

          People

            tomazcerar Tomaž Cerar (Inactive)
            bstansbe@redhat.com Brian Stansberry
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: