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

Resource Adapter can't be deleted after restarting server

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 14.0.1.Final, 11.0.0.Final, 17.0.1.Final, 19.1.0.Final
    • Fix Version/s: None
    • Component/s: JCA
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      All steps were performed on WildFly 11.0.0.Final but the bug can be also reproduced on WildFly 14.0.1.Final and WildFly 17.0.1.Final (haven't checked newest versions of WildFly yet).
      1. I developed a very simple connector which was actually taken from https://github.com/fmarchioni/mastertheboss/tree/master/jca-demo (I attached source code of the jca in scope of the issue), compiled it and got the jca-demo-1.0.rar archive.
      2. put the jca-demo-1.0.rar archive to deployments folder.
      3. start the server.
      4. after deploying the jca-demo-1.0.rar run the following cli commands:

      /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:add(archive=jca-demo-1.0.rar, transaction-support=NoTransaction)
      /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1/connection-definitions=jcaDemo_VDB_ID_1:add(jndi-name=java:/jcaDemo_VDB_ID_1, enabled=true, class-name=com.sample.adapter.HelloWorldManagedConnectionFactory, min-pool-size=0, max-pool-size=20){allow-resource-service-restart=true}
      /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:activate
      

      in server.log you can see the following (the log was taken from WildFly 11.0.0.Final):

      2020-02-20 12:03:33,103 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-5) IJ020001: Required license terms for file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/temp840fa23b95ebcc91/content-85ce6bdbfce5b3b5/contents/                                                                                                   2020-02-20 12:03:33,115 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-5) WFLYJCA0007: Registered connection factory java:/jcaDemo_VDB_ID_1                          2020-02-20 12:03:33,121 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-5) IJ020002: Deployed: file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/temp840fa23b95ebcc91/content-85ce6bdbfce5b3b5/contents/                                                                                                                    2020-02-20 12:03:33,123 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-6) WFLYJCA0002: Bound JCA ConnectionFactory [java:/jcaDemo_VDB_ID_1]
      

      5. if you try to run the cli command before restarting the server:

      /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:remove{allow-resource-service-restart=true}
      

      in the server.log you will see the following:

      2020-02-20 12:03:51,146 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-1) WFLYJCA0011: Unbound JCA ConnectionFactory [java:/jcaDemo_VDB_ID_1]
      

      6. if you removed the resource adapter during the 5. step and before restarting the server, please, repeat the 4. step to create the resource adapter again.
      7. restart the server.
      8. try to run the cli command:

      /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:remove{allow-resource-service-restart=true}
      

      the server will generate the following lines in the server.log:

      2020-02-20 12:05:43,653 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0070: Deployment restart detected for deployment jca-demo-1.0.rar, performing full redeploy instead.                                                                                                                                                                         2020-02-20 12:05:43,693 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0028: Stopped deployment jca-demo-1.0.rar (runtime-name: jca-demo-1.0.rar) in 35ms     2020-02-20 12:05:43,698 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "jca-demo-1.0.rar" (runtime-name: "jca-demo-1.0.rar")     2020-02-20 12:05:44,130 INFO  [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-3) IJ020001: Required license terms for file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/tempa8f374a95f0436c6/content-72dc113b1d3ebdfb/contents/                                                                                                      2020-02-20 12:05:44,139 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020001: Required license terms for file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/tempa8f374a95f0436c6/content-72dc113b1d3ebdfb/contents/                                                                                                   2020-02-20 12:05:44,154 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0007: Registered connection factory java:/jcaDemo_VDB_ID_1                          2020-02-20 12:05:44,161 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020002: Deployed: file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/tempa8f374a95f0436c6/content-72dc113b1d3ebdfb/contents/                                                                                                                    2020-02-20 12:05:44,171 INFO  [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0002: Bound JCA ConnectionFactory [java:/jcaDemo_VDB_ID_1]
      

      at the same time the "remove" cli command will return the following response:

      [standalone@localhost:9990 /] /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:remove{allow-resource-service-restart=true}
      {
          "outcome" => "failed",
          "failure-description" => "WFLYCTL0171: Removing services has lead to unsatisfied dependencies:
      Service jboss.resourceadapters.ra.jcaDemo_VDB_ID_1 was depended upon by service jboss.deployment.unit.\"jca-demo-1.0.rar\".INSTALL",
          "rolled-back" => true
      }
      
      Show
      All steps were performed on WildFly 11.0.0.Final but the bug can be also reproduced on WildFly 14.0.1.Final and WildFly 17.0.1.Final (haven't checked newest versions of WildFly yet). 1. I developed a very simple connector which was actually taken from https://github.com/fmarchioni/mastertheboss/tree/master/jca-demo (I attached source code of the jca in scope of the issue), compiled it and got the jca-demo-1.0.rar archive. 2. put the jca-demo-1.0.rar archive to deployments folder. 3. start the server. 4. after deploying the jca-demo-1.0.rar run the following cli commands: /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:add(archive=jca-demo-1.0.rar, transaction-support=NoTransaction) /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1/connection-definitions=jcaDemo_VDB_ID_1:add(jndi-name=java:/jcaDemo_VDB_ID_1, enabled= true , class- name=com.sample.adapter.HelloWorldManagedConnectionFactory, min-pool-size=0, max-pool-size=20){allow-resource-service-restart= true } /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:activate in server.log you can see the following (the log was taken from WildFly 11.0.0.Final): 2020-02-20 12:03:33,103 INFO [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-5) IJ020001: Required license terms for file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/temp840fa23b95ebcc91/content-85ce6bdbfce5b3b5/contents/ 2020-02-20 12:03:33,115 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-5) WFLYJCA0007: Registered connection factory java:/jcaDemo_VDB_ID_1 2020-02-20 12:03:33,121 INFO [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-5) IJ020002: Deployed: file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/temp840fa23b95ebcc91/content-85ce6bdbfce5b3b5/contents/ 2020-02-20 12:03:33,123 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-6) WFLYJCA0002: Bound JCA ConnectionFactory [java:/jcaDemo_VDB_ID_1] 5. if you try to run the cli command before restarting the server: /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:remove{allow-resource-service-restart= true } in the server.log you will see the following: 2020-02-20 12:03:51,146 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-1) WFLYJCA0011: Unbound JCA ConnectionFactory [java:/jcaDemo_VDB_ID_1] 6. if you removed the resource adapter during the 5. step and before restarting the server, please, repeat the 4. step to create the resource adapter again. 7. restart the server. 8. try to run the cli command: /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:remove{allow-resource-service-restart= true } the server will generate the following lines in the server.log: 2020-02-20 12:05:43,653 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0070: Deployment restart detected for deployment jca-demo-1.0.rar, performing full redeploy instead. 2020-02-20 12:05:43,693 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0028: Stopped deployment jca-demo-1.0.rar (runtime-name: jca-demo-1.0.rar) in 35ms 2020-02-20 12:05:43,698 INFO [org.jboss.as.server.deployment] (MSC service thread 1-5) WFLYSRV0027: Starting deployment of "jca-demo-1.0.rar" (runtime-name: "jca-demo-1.0.rar" ) 2020-02-20 12:05:44,130 INFO [org.jboss.as.connector.deployers.RADeployer] (MSC service thread 1-3) IJ020001: Required license terms for file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/tempa8f374a95f0436c6/content-72dc113b1d3ebdfb/contents/ 2020-02-20 12:05:44,139 INFO [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020001: Required license terms for file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/tempa8f374a95f0436c6/content-72dc113b1d3ebdfb/contents/ 2020-02-20 12:05:44,154 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0007: Registered connection factory java:/jcaDemo_VDB_ID_1 2020-02-20 12:05:44,161 INFO [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020002: Deployed: file:/C:/DataVirtuality/wildfly-11.0.0.Final/standalone/tmp/vfs/temp/tempa8f374a95f0436c6/content-72dc113b1d3ebdfb/contents/ 2020-02-20 12:05:44,171 INFO [org.jboss.as.connector.deployment] (MSC service thread 1-3) WFLYJCA0002: Bound JCA ConnectionFactory [java:/jcaDemo_VDB_ID_1] at the same time the "remove" cli command will return the following response: [standalone@localhost:9990 /] /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:remove{allow-resource-service-restart= true } { "outcome" => "failed" , "failure-description" => "WFLYCTL0171: Removing services has lead to unsatisfied dependencies: Service jboss.resourceadapters.ra.jcaDemo_VDB_ID_1 was depended upon by service jboss.deployment.unit.\ "jca-demo-1.0.rar\" .INSTALL", "rolled-back" => true }

      Description

      The issue is related to the WFLY-6774 issue. I'm working with Teiid and should create/delete resource adapters many times, especially resource adapters based on the same archive. The WFLY-6774 fix works well before the restarting server allowing me to create/delete resource adapters without restarting the server. Once I restart the server and try to remove a resource adapter based on an archive I'll get the following error:

      [standalone@localhost:9990 /] /subsystem=resource-adapters/resource-adapter=jcaDemo_VDB_ID_1:remove{allow-resource-service-restart=true}
      {
          "outcome" => "failed",
          "failure-description" => "WFLYCTL0171: Removing services has lead to unsatisfied dependencies:
      Service jboss.resourceadapters.ra.jcaDemo_VDB_ID_1 was depended upon by service jboss.deployment.unit.\"jca-demo-1.0.rar\".INSTALL",
          "rolled-back" => true
      }
      

      After showing the error server will rollback the "remove" command deploying the jca-demo-1.0.rar archive again and re-creating the jcaDemo_VDB_ID_1 resource adapter. As a result I can't remove the resource adapter via cli commands, it can be removed only manually (removing the resource adapter in standalone.xml). The bug can be reproduced (at least versions which I checked) on WildFly 11.0.0.Final, WildFly 14.0.1.Final and WildFly 17.0.1.Final.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  istudens Ivo Studensky
                  Reporter:
                  dalex005 Dmitrii Pogorelov
                • Votes:
                  2 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated: