Method createActivationSpecs in EJBUtilities fails to look up the resource adapter if
multiple RA's with the same impl class are deployed in AS7
------------------------------------------------------------------------------------------------------------------------------------------------
Key: AS7-2761
URL:
https://issues.jboss.org/browse/AS7-2761
Project: Application Server 7
Issue Type: Bug
Components: EJB
Affects Versions: 7.1.0.Beta1
Reporter: Ivo Studensky
Assignee: Carlo de Wolf
It seems there is a bug in
org.jboss.as.ejb3.component.EJBUtilities#createActivationSpecs() which denies to look up
the Resource Adapter when more than one RA deployed to AS have the same package of their
impl class. The issue was hit by TCK6 tests, see [1]. According to the AS server.log, the
TCK tests fail in deployment phase due to:
{noformat}
Caused by: java.lang.IllegalStateException: JBAS014332: found more than one RA registered
as whitebox-tx
at
org.jboss.as.ejb3.component.EJBUtilities.createActivationSpecs(EJBUtilities.java:126)
{noformat}
But it seems that TCK tests are configured and packaged right and there really is only one
rar deployment with name 'whitebox-tx'. The problem seems to be in the following
code snippet from EJBUtilities class where the package of the impl class of found RA is
checked against packages of impl classes of other deployed RA's. If there is any RA
which begins with the same package name, i.e. its impl class is in the same package or in
a subpackage, then the code throws multipleResourceAdapterRegistered exception, although
there is only one RA with the specified name.
EJBUtilities#createActivationSpecs() snippet:
{code}
boolean found = false;
for (String id : ids) {
if (id.startsWith(packageName)) {
if (!found) {
listeners =
getResourceAdapterRepository().getMessageListeners(id);
found = true;
} else {
line 126 ---> throw
MESSAGES.multipleResourceAdapterRegistered(resourceAdapterName);
}
}
}
{code}
In the TCK's test case, at the line marked above the 'packageName' is equal to
"com.sun.ts.tests.common.connector.whitebox", the 'id' to
"com.sun.ts.tests.common.connector.whitebox.XAResourceAdapterImpl#1" and the
'ids' collection to:
{noformat}
ids = {java.util.Collections$UnmodifiableSet@7199} size = 7
[0] =
{java.lang.String(a)7287}"com.sun.ts.tests.common.connector.whitebox.LocalTxResourceAdapterImpl#2"
[1] =
{java.lang.String(a)7202}"com.sun.ts.tests.common.connector.whitebox.XAResourceAdapterImpl#1"
[2] =
{java.lang.String(a)7288}"com.sun.ts.tests.common.connector.whitebox.NoTxResourceAdapterImpl#1"
[3] =
{java.lang.String(a)7289}"com.sun.ts.tests.common.connector.whitebox.XAResourceAdapterImpl#2"
[4] =
{java.lang.String(a)7290}"com.sun.ts.tests.common.connector.whitebox.ibanno.IBAnnotatedResourceAdapterImpl#1"
[5] =
{java.lang.String(a)7291}"com.sun.ts.tests.common.connector.whitebox.NoTxResourceAdapterImpl#2"
[6] =
{java.lang.String(a)7292}"com.sun.ts.tests.common.connector.whitebox.LocalTxResourceAdapterImpl#1"
{noformat}
Maybe I did not understand the code above correctly, but to me it seems to be a bug.
[1]
https://hudson.qa.jboss.com/hudson/view/TCK6-AS7/job/tck6-as7-connector/l...
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira