[jboss-jira] [JBoss JIRA] (WFLY-13144) Resource Adapter can't be deleted after restarting server
Dmitrii Pogorelov (Jira)
issues at jboss.org
Tue Jul 14 13:03:00 EDT 2020
[ https://issues.redhat.com/browse/WFLY-13144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14240016#comment-14240016 ]
Dmitrii Pogorelov commented on WFLY-13144:
------------------------------------------
[~istudens] , just for info, and maybe it will ease your investigations later: I investigated the bug and debugged the WildFly connector module. The bug occurred because of the RaXmlDependencyProcessor class which was added in the scope of the WFLY-1701 issue ([https://github.com/wildfly/wildfly/commit/22e122911edf2a77c992285db140d07021f8ee79]). The RaXmlDependencyProcessor.deploy method adds a dependency on the jboss.resourceadapters.ra.jcaDemo_VDB_ID_1 service:
{code:java}
if (resourceAdaptersMap != null && resourceAdaptersMap.get(deploymentUnitName) != null) {
for (ServiceName serviceName : resourceAdaptersMap.get(deploymentUnitName)) {
phaseContext.addDeploymentDependency(serviceName, AttachmentKey
.create(ModifiableResourceAdapter.class));
}
} {code}
which in turn adds the jboss.resourceadapters.ra.jcaDemo_VDB_ID_1 service name as a dependency (required collection) to the jboss.deployment.unit."jca-demo-1.0.rar".INSTALL service. When removing the "jcaDemo_VDB_ID_1" resource adapter on the fly (using the allow-resource-service-restart=true header in Cli command) the RaRemove class doesn't remove the jboss.resourceadapters.ra.jcaDemo_VDB_ID_1 dependency from the jboss.deployment.unit."jca-demo-1.0.rar".INSTALL service which leads to the error from the issue description:
{code:java}
[standalone at 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
} {code}
I tried to comment out the:
{code:java}
phaseContext.addDeploymentDependency(serviceName, AttachmentKey .create(ModifiableResourceAdapter.class));{code}
in the RaXmlDependencyProcessor class (because actually when we add a new resource adapter on the fly the RaXmlDependencyProcessor.deploy method is not being called at all and jboss.deployment.unit."SOME ARCHIVE".INSTALL service is not getting any dependencies, the RaXmlDependencyProcessor.deploy method is called only during WildFly bootstrapping, that's why a resource adapter can be added/removed without any errors on already started server) and it solved the problem. I'm not sure but maybe you should either re-work/remove the RaXmlDependencyProcessor class or remove correctly the jboss.resourceadapters.ra.jcaDemo_VDB_ID_1 service dependency from jboss.deployment.unit."jca-demo-1.0.rar".INSTALL service in the RaRemove class.
> Resource Adapter can't be deleted after restarting server
> ---------------------------------------------------------
>
> Key: WFLY-13144
> URL: https://issues.redhat.com/browse/WFLY-13144
> Project: WildFly
> Issue Type: Bug
> Components: JCA
> Affects Versions: 14.0.1.Final, 11.0.0.Final, 17.0.1.Final, 19.1.0.Final
> Reporter: Dmitrii Pogorelov
> Assignee: Ivo Studensky
> Priority: Critical
> Attachments: jca-demo-1.0.rar, jcademo-source-code.rar
>
>
> 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:
> {code}
> [standalone at 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
> }
> {code}
> 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.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list