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

operations on deployments fail with assertions enabled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • 19.0.0.Beta18
    • None
    • Management
    • None
    • Hide

      Apply patch below and run:

      mvn test -Dtest=IronJacamarDeploymentTestCase
      
      diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/ijdeployment/IronJacamarDeploymentTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/ijdeployment/IronJacamarDeploymentTestCase.java
      index 40801992ae..9356cbf109 100644
      --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/ijdeployment/IronJacamarDeploymentTestCase.java
      +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/ijdeployment/IronJacamarDeploymentTestCase.java
      @@ -34,6 +34,7 @@ import java.util.Properties;
       import org.jboss.arquillian.container.test.api.Deployment;
       import org.jboss.arquillian.container.test.api.RunAsClient;
       import org.jboss.arquillian.junit.Arquillian;
      +import org.jboss.as.controller.client.helpers.ClientConstants;
       import org.jboss.as.test.integration.jca.beanvalidation.ra.ValidResourceAdapter;
       import org.jboss.as.test.integration.management.base.ContainerResourceMgmtTestBase;
       import org.jboss.dmr.ModelNode;
      @@ -95,6 +96,13 @@ public class IronJacamarDeploymentTestCase extends ContainerResourceMgmtTestBase
               operation.get(INCLUDE_RUNTIME).set(true);
               ModelNode result = executeOperation(operation);
       
      +        ModelNode write = new ModelNode();
      +        write.get(OP).set("write-attribute");
      +        write.get(OP_ADDR).set(address.clone().add("connection-definitions", "java:jboss/VCF"));
      +        write.get(ClientConstants.NAME).set("enlistment-trace");
      +        write.get(ClientConstants.VALUE).set(true);
      +        executeOperation(write);
      +
               assertEquals("Bootstrap-context value is wrong", result.get("bootstrap-context").asString(), "default");
               assertEquals("Transaction-support value is wrong", result.get("transaction-support").asString(), "XATransaction");
               assertEquals("RA config property value is wrong", result.get("config-properties", "raProperty", "value").asString(),
      
      Show
      Apply patch below and run: mvn test -Dtest=IronJacamarDeploymentTestCase diff --git a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/ijdeployment/IronJacamarDeploymentTestCase.java b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/ijdeployment/IronJacamarDeploymentTestCase.java index 40801992ae..9356cbf109 100644 --- a/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/ijdeployment/IronJacamarDeploymentTestCase.java +++ b/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/jca/ijdeployment/IronJacamarDeploymentTestCase.java @@ -34,6 +34,7 @@ import java.util.Properties; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.container.test.api.RunAsClient; import org.jboss.arquillian.junit.Arquillian; + import org.jboss.as.controller.client.helpers.ClientConstants; import org.jboss.as.test.integration.jca.beanvalidation.ra.ValidResourceAdapter; import org.jboss.as.test.integration.management.base.ContainerResourceMgmtTestBase; import org.jboss.dmr.ModelNode; @@ -95,6 +96,13 @@ public class IronJacamarDeploymentTestCase extends ContainerResourceMgmtTestBase operation.get(INCLUDE_RUNTIME).set( true ); ModelNode result = executeOperation(operation); + ModelNode write = new ModelNode(); + write.get(OP).set( "write-attribute" ); + write.get(OP_ADDR).set(address.clone().add( "connection-definitions" , "java:jboss/VCF" )); + write.get(ClientConstants.NAME).set( "enlistment-trace" ); + write.get(ClientConstants.VALUE).set( true ); + executeOperation(write); + assertEquals( "Bootstrap-context value is wrong" , result.get( "bootstrap-context" ).asString(), " default " ); assertEquals( "Transaction-support value is wrong" , result.get( "transaction-support" ).asString(), "XATransaction" ); assertEquals( "RA config property value is wrong" , result.get( "config-properties" , "raProperty" , "value" ).asString(),

      With assertions enabled ('-ea' java parameter) some operations on deployments fail.

      Example operation:

      /deployment=_DEFAULT___DEFAULT__ij.rar/subsystem=resource-adapters/ironjacamar=ironjacamar/resource-adapter=_DEFAULT___DEFAULT__ij.rar/connection-definitions=java\:jboss\/VCF:write-attribute(name=enlistment-trace, value=true
      

      fails with:

      17:05:43,485 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("write-attribute") failed - address: ([
          ("deployment" => "test.rar"),
          ("subsystem" => "resource-adapters"),
          ("ironjacamar" => "ironjacamar"),
          ("resource-adapter" => "test.rar"),
          ("connection-definitions" => "java:jboss/VCF")
      ]): java.lang.AssertionError
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.operations.global.WriteAttributeHandler.execute(WriteAttributeHandler.java:122)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:1045)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:777)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:466)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1433)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:449)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.ModelControllerImpl.lambda$executeForResponse$0(ModelControllerImpl.java:260)
              at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:304)
              at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:270)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.ModelControllerImpl.executeForResponse(ModelControllerImpl.java:260)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.ModelControllerImpl.executeOperation(ModelControllerImpl.java:254)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:237)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:241)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1$1.run(ModelControllerClientOperationHandler.java:163)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1$1.run(ModelControllerClientOperationHandler.java:159)
              at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:328)
              at org.wildfly.security.elytron-base@2.0.0.Final//org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:285)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)
              at org.jboss.as.controller@19.0.0.Beta18//org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:159)
              at org.jboss.as.protocol@19.0.0.Beta18//org.jboss.as.protocol.mgmt.ManagementRequestContextImpl$1.doExecute(ManagementRequestContextImpl.java:70)
              at org.jboss.as.protocol@19.0.0.Beta18//org.jboss.as.protocol.mgmt.ManagementRequestContextImpl$AsyncTaskRunner.run(ManagementRequestContextImpl.java:160)
              at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
              at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
              at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
              at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
              at java.base/java.lang.Thread.run(Thread.java:829)
              at org.jboss.threads@2.4.0.Final//org.jboss.threads.JBossThread.run(JBossThread.java:513)
      

      Discussed on Zulip: https://wildfly.zulipchat.com/#narrow/stream/174184-wildfly-developers/topic/write-attribute.20on.20deployment.20failing.20on.20assertion

      Remarks:

      Brian Stansberry: the assertion is technically correct but in practice we should probably relax it
      Brian Stansberry: the problem is AttributeDefinition instances end up being shared between main subsystem and deployment resources
      Brian Stansberry: deployment resources should return 'true' from registry.isRuntimeOnly(). For a long time many didn't, which was a bug, but that was recently cleaned up
      Brian Stansberry: but that likely exposed the issue you are seeing, where AD instances get shared between a normal and a deploymet resource
      Brian Stansberry: I think it would be too much trouble and risk to 'unshare' those ADs, so we should fix this another way
      Brian Stansberry: probably by checking how read-resource-description / read-operation-description work to ensure it only reports StorageType.RUNTIME for attributes on runtime-only resources, regardless of what the AD says
      Brian Stansberry: and then remove that assert
      Brian Stansberry: well really remove the assert and then deal with read-resource-description

      Priority is set to minor because assertions aren't enabled in production, arquillian enables them by default though.

              jmesnil1@redhat.com Jeff Mesnil
              msimka@redhat.com Martin Simka
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: