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

Resource adapters subsystem does not accept expression for wm-security attribute

XMLWordPrintable

    • Hide
      1. Run server with atteched config
      2. Rxecute cli:
        /subsystem=resource-adapters/resource-adapter=generic-jms-ra.rar:write-attribute(name=wm-security, value=${test:false})
        
      Show
      Run server with atteched config Rxecute cli: /subsystem=resource-adapters/resource-adapter= generic -jms-ra.rar:write-attribute(name=wm-security, value=${test: false })
    • Undefined
    • ---
    • ---

      Resource adapters subsystem supports expression for wm-security:

       "wm-security" => {
                      "type" => BOOLEAN,
                      "description" => "Toggle on/off wm.security for this resource adapter. In case of false all wm-security-* parameters are ignored, even the defaults.",
                      "expressions-allowed" => true,
                      "required" => false,
                      "nillable" => true,
                      "default" => false,
                      "access-type" => "read-write",
                      "storage" => "configuration",
                      "restart-required" => "all-services"
                  },
      
      

      however it fails to marshall it:

      /subsystem=resource-adapters/resource-adapter=generic-jms-ra.rar:write-attribute(name=wm-security, value=${test:false})
      
      22:03:35,638 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0008: Failed to persist configuration change: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0084: Failed to marshal configuration
      	at org.jboss.as.controller.persistence.AbstractFilePersistenceResource.<init>(AbstractFilePersistenceResource.java:53)
      	at org.jboss.as.controller.persistence.ConfigurationFilePersistenceResource.<init>(ConfigurationFilePersistenceResource.java:46)
      	at org.jboss.as.controller.persistence.BackupXmlConfigurationPersister.store(BackupXmlConfigurationPersister.java:120)
      	at org.jboss.as.controller.ModelControllerImpl.writeModel(ModelControllerImpl.java:728)
      	at org.jboss.as.controller.OperationContextImpl.createPersistenceResource(OperationContextImpl.java:535)
      	at org.jboss.as.controller.AbstractOperationContext.executeDoneStage(AbstractOperationContext.java:821)
      	at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:770)
      	at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:468)
      	at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1415)
      	at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:431)
      	at org.jboss.as.controller.ModelControllerImpl.lambda$execute$1(ModelControllerImpl.java:248)
      	at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:304)
      	at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:270)
      	at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:248)
      	at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:240)
      	at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.access$400(ModelControllerClientOperationHandler.java:138)
      	at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1$1.run(ModelControllerClientOperationHandler.java:162)
      	at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1$1.run(ModelControllerClientOperationHandler.java:158)
      	at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:328)
      	at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:285)
      	at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)
      	at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)
      	at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:158)
      	at org.jboss.as.protocol.mgmt.ManagementRequestContextImpl$1.doExecute(ManagementRequestContextImpl.java:70)
      	at org.jboss.as.protocol.mgmt.ManagementRequestContextImpl$AsyncTaskRunner.run(ManagementRequestContextImpl.java:160)
      	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)
      	at org.jboss.threads.JBossThread.run(JBossThread.java:513)
      Caused by: org.jboss.as.controller.persistence.ConfigurationPersistenceException: WFLYCTL0089: Failed to write configuration
      	at org.jboss.as.controller.persistence.AbstractConfigurationPersister.marshallAsXml(AbstractConfigurationPersister.java:112)
      	at org.jboss.as.controller.persistence.AbstractFilePersistenceResource.<init>(AbstractFilePersistenceResource.java:46)
      	... 30 more
      Caused by: java.lang.IllegalArgumentException
      	at org.jboss.dmr.ModelValue.asBoolean(ModelValue.java:69)
      	at org.jboss.dmr.ModelNode.asBoolean(ModelNode.java:324)
      	at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterSubsystemParser.writeRaElement(ResourceAdapterSubsystemParser.java:183)
      	at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterSubsystemParser.writeContent(ResourceAdapterSubsystemParser.java:148)
      	at org.jboss.as.connector.subsystems.resourceadapters.ResourceAdapterSubsystemParser.writeContent(ResourceAdapterSubsystemParser.java:130)
      	at org.jboss.as.server.parsing.CommonXml.writeSubsystems(CommonXml.java:281)
      	at org.jboss.as.server.parsing.StandaloneXml_16.writeServerProfile(StandaloneXml_16.java:830)
      	at org.jboss.as.server.parsing.StandaloneXml_16.writeContent(StandaloneXml_16.java:760)
      	at org.jboss.as.server.parsing.StandaloneXml.writeContent(StandaloneXml.java:151)
      	at org.jboss.as.server.parsing.StandaloneXml.writeContent(StandaloneXml.java:52)
      	at org.jboss.staxmapper.XMLMapperImpl.doDeparse(XMLMapperImpl.java:96)
      	at org.jboss.staxmapper.XMLMapperImpl.deparseDocument(XMLMapperImpl.java:91)
      	at org.jboss.as.controller.persistence.AbstractConfigurationPersister.marshallAsXml(AbstractConfigurationPersister.java:106)
      	... 31 more
      
      

      The error is caused by [1] where the parser does not resolve an expression but try to read is as boolean.

      [1] https://github.com/wildfly/wildfly/blob/22.0.0.Final/connector/src/main/java/org/jboss/as/connector/subsystems/resourceadapters/ResourceAdapterSubsystemParser.java#L183

            pberan@redhat.com Petr Beran
            istraka@redhat.com Ivan Straka
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: