Bug 1012044

Summary: resource-adapter id attribute has to match ra name otherwise MDB is not deployed
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ondrej Chaloupka <ochaloup>
Component: JCAAssignee: Stefano Maestri <smaestri>
Status: CLOSED CURRENTRELEASE QA Contact: Ondrej Chaloupka <ochaloup>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.0CC: brian.stansberry, dandread, jawilson, jdoyle, jpederse, mnovak, msvehla, myarboro, pslavice, smcgowan
Target Milestone: CR1Keywords: Regression
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:21:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1026924    

Description Ondrej Chaloupka 2013-09-25 15:26:42 UTC
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 15:29:50 UTC
There needs to be an upstream JIRA (WFLY), and ideally a test case

Comment 3 Ondrej Chaloupka 2013-09-26 09:30:11 UTC
I need to add: this was hit on EAP 6.2.0.ER3

Comment 4 Stefano Maestri 2013-10-01 20:59:54 UTC
I've send a PR for this
https://github.com/jbossas/jboss-eap/pull/501

Comment 10 Ondrej Chaloupka 2013-10-17 15:13:21 UTC
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 08:01:08 UTC
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 22:09:32 UTC
Changing ER6 to ER7 in case it makes it.

Comment 14 Ondrej Chaloupka 2013-11-05 10:06:05 UTC
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 17:59:11 UTC
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-06 03:10:29 UTC
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 14:58:37 UTC
https://github.com/jbossas/jboss-eap/pull/673

Comment 29 Stefano Maestri 2013-11-08 21:58:21 UTC
New PR sent

https://github.com/jbossas/jboss-eap/pull/689

Comment 30 Ondrej Chaloupka 2013-11-11 15:23:56 UTC
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 15:50:50 UTC
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 07:22:14 UTC
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 08:54:20 UTC
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 09:05:13 UTC
OK, thank you.
In this way it works fine.