Bug 1012044 - resource-adapter id attribute has to match ra name otherwise MDB is not deployed
resource-adapter id attribute has to match ra name otherwise MDB is not depl...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: JCA (Show other bugs)
6.2.0
Unspecified Unspecified
unspecified Severity high
: CR1
: EAP 6.2.0
Assigned To: Stefano Maestri
Ondrej Chaloupka
: Regression
Depends On:
Blocks: 1026924
  Show dependency treegraph
 
Reported: 2013-09-25 11:26 EDT by Ondrej Chaloupka
Modified: 2017-10-09 20:14 EDT (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-12-15 11:21:42 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-2383 Major Closed resource-adapter id attribute has to match ra name otherwise MDB is not deployed 2018-03-19 15:36 EDT
JBoss Issue Tracker WFLY-2428 Major Closed MDBs should use the full identifier of the resource adapter 2018-03-19 15:36 EDT

  None (edit)
Description Ondrej Chaloupka 2013-09-25 11:26:42 EDT
I think that fix from bz https://bugzilla.redhat.com/show_bug.cgi?id=996971 came with regression.

The resource-adapter id has to have the same name as the ra archive has. Otherwise the the MDB is not deployed. 

It seems that the RA is deployed as combination of resource-adapter id and name of the archive name: e.g.:
service jboss.ra.deployment."wmq.jmsra.rar_ibm-resource-adapter"

Then MDB failed with unavailable dependency as it's searching for resource adapter archive name:
16:50:40,263 ERROR [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "mdb-test.jar" was rolled back with the following failure message: {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"mdb-test.jar\".component.mdb.CREATE is missing [jboss.ra.\"wmq.jmsra\"]"]}
Comment 1 Jesper Pedersen 2013-09-25 11:29:50 EDT
There needs to be an upstream JIRA (WFLY), and ideally a test case
Comment 3 Ondrej Chaloupka 2013-09-26 05:30:11 EDT
I need to add: this was hit on EAP 6.2.0.ER3
Comment 4 Stefano Maestri 2013-10-01 16:59:54 EDT
I've send a PR for this
https://github.com/jbossas/jboss-eap/pull/501
Comment 10 Ondrej Chaloupka 2013-10-17 11:13:21 EDT
I still get the failure for EAP 6.2.0.ER6.
I've checked the code and the PR https://github.com/jbossas/jboss-eap/pull/501 seems to be applied in the ER6.
Comment 11 Vladimir Rastseluev 2013-10-23 04:01:08 EDT
I also tested this scenario on resource adapter, included as module. There is the same problem: if id attribute isn't equal to module name e.g. "org.jboss.something", MDB deployment fails also.
Comment 12 Dimitris Andreadis 2013-10-24 18:09:32 EDT
Changing ER6 to ER7 in case it makes it.
Comment 14 Ondrej Chaloupka 2013-11-05 05:06:05 EST
This was not fixed. When I use the same rar name for archive and id and mdb link then I get exception [1] (I'm working with activemq). The only way how to really load the RAR I have to define names in the following way:

<subsystem xmlns="urn:jboss:domain:ejb3:1.4">
 <mdb>
  <resource-adapter-ref resource-adapter-name="activemq.rar"/>
  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
 </mdb>
 ...

<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
 <resource-adapters>
  <resource-adapter id="activemq">
   <archive>activemq.rar</archive>
   ...

which means that archive has to be archive.rar and the id just archive.



[1]
ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."jbossts_crashrecovery-jms-mdb_crashrecovery-jms-mdb.jar".component.mdb.CREATE: org.jboss.msc.service.StartException in service jboss.deployment.unit."jbossts_crashrecovery-jms-mdb_crashrecovery-jms-mdb.jar".component.mdb.CREATE: Failed to start service
 at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1767) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
 at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: java.lang.IllegalStateException: JBAS014331: No resource adapter registered with resource adapter name activemq
 at org.jboss.as.ejb3.component.EJBUtilities.createActivationSpecs(EJBUtilities.java:85)
 at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentCreateService.createComponent(MessageDrivenComponentCreateService.java:93)
 at org.jboss.as.ee.component.BasicComponentCreateService.start(BasicComponentCreateService.java:91)
 at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentCreateService.start(MessageDrivenComponentCreateService.java:79)
 at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
 at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
 ... 3 more
Comment 19 Dimitris Andreadis 2013-11-05 12:59:11 EST
Stefano, are you looking at it? This is the final week to get fixes for CR, which should hopefully be the last build.
Comment 21 Shelly McGowan 2013-11-05 22:10:29 EST
There are EAP 6 ER7 TCK failures in the connector/localTx/msginflow and ejb/bb/mdb/customerlistener tests are related to this issue.
Comment 22 Stefano Maestri 2013-11-06 09:58:37 EST
https://github.com/jbossas/jboss-eap/pull/673
Comment 29 Stefano Maestri 2013-11-08 16:58:21 EST
New PR sent

https://github.com/jbossas/jboss-eap/pull/689
Comment 30 Ondrej Chaloupka 2013-11-11 10:23:56 EST
Ok, it seems that this works for creating modules but this does not work for archive deployments.

You have to set the id of resource adapter to name of archive with or without ".rar". Otherwise the rar is not loaded for the MDB.
But I would suppose that it should be possible to set whatever string to the id.
At least it worked in EAP 6.1.1.GA.

When you configure resource adapter as archive then you can set it like:
<subsystem xmlns="urn:jboss:domain:ejb3:1.4">
 <mdb>
  <resource-adapter-ref resource-adapter-name="activemq.file.rar"/>
  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
 </mdb>
 ...
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
 <resource-adapters>
  <resource-adapter id="activemq.file">
  <!-- OR <resource-adapter id="activemq.file.rar"> -->
   <archive>activemq.file.rar</archive>
Comment 31 Stefano Maestri 2013-11-11 10:50:50 EST
Well starting w/ your example I've just tried those 3 config:

<subsystem xmlns="urn:jboss:domain:ejb3:1.4">
 <mdb>
  <resource-adapter-ref resource-adapter-name="wmq.jmsra.rar"/>
  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
 </mdb>
 ...
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
 <resource-adapters>
  <resource-adapter id="wmq.jmsra">
   <archive>wmq.jmsra.rar</archive>




<subsystem xmlns="urn:jboss:domain:ejb3:1.4">
 <mdb>
  <resource-adapter-ref resource-adapter-name="wmq.jmsra.rar"/>
  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
 </mdb>
 ...
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
 <resource-adapters>
  <resource-adapter id="wmq.jmsra.rar">
   <archive>wmq.jmsra.rar</archive>



<subsystem xmlns="urn:jboss:domain:ejb3:1.4">
 <mdb>
  <resource-adapter-ref resource-adapter-name="ibm-resource-adapter"/>
  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
 </mdb>
 ...
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
 <resource-adapters>
  <resource-adapter id="ibm-resource-adapter">
   <archive>wmq.jmsra.rar</archive>

All of them worked for me (EAP 6.x branch)
What am I not covering?
Comment 32 Ondrej Chaloupka 2013-11-12 02:22:14 EST
Hi Stefano,

You are right and the fix works well. I'm sorry for not putting my intention clearly.

I failed the issue from the point of view of the regression against the EAP 6.1.1.GA. In the past release there was needed to use archive name as pointer for the mdb resource adapter name. I mean this works under 6.1.1 (and does not work for 6.2.0).
<subsystem xmlns="urn:jboss:domain:ejb3:1.4">
 <mdb>
  <resource-adapter-ref resource-adapter-name="wmq.jmsra.rar"/>
  <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
 </mdb>
 ...
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
 <resource-adapters>
  <resource-adapter id="wmq-jms-ra-id-name">
   <archive>wmq.jmsra.rar</archive>

This regression was the original reason of filling this bug. Neverless the prior fix came with another type of problem I was still thinking about the original one.

If you consider the current behavior correct then I'm fine with verify the issue. I just worried about different behavior between EAP 6.1.1 and 6.2.0 versions.

Thanks
Ondra
Comment 33 Stefano Maestri 2013-11-12 03:54:20 EST
Yup, current behavior is the correct one. It's because you could have more than one resource-adapter pointing on the same rar, and so it's clear that we have to use id and not rar name to point the ra. And we can't do any special case for single resource-adapter because we can't know if and when a user decide to add an activation runtime (including ironjacamar.xml in rar, or using CLI)

regards
S.
Comment 34 Ondrej Chaloupka 2013-11-12 04:05:13 EST
OK, thank you.
In this way it works fine.

Note You need to log in before you can comment on or make changes to this bug.