[jboss-jira] [JBoss JIRA] (AS7-2761) Method createActivationSpecs in EJBUtilities fails to look up the resource adapter if multiple RA's with the same impl class are deployed in AS7
Jesper Pedersen (Updated) (JIRA)
jira-events at lists.jboss.org
Wed Nov 23 12:18:40 EST 2011
[ https://issues.jboss.org/browse/AS7-2761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jesper Pedersen updated AS7-2761:
---------------------------------
Description:
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. According to the AS server.log, the tests fail in deployment phase due to:
{noformat}
Caused by: java.lang.IllegalStateException: JBAS014332: found more than one RA registered as app-rar
at org.jboss.as.ejb3.component.EJBUtilities.createActivationSpecs(EJBUtilities.java:126)
{noformat}
But it seems that tests are configured and packaged right and there really is only one rar deployment with name 'app-rar'. 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 test case, at the line marked above the 'packageName' is equal to "foo.bar", the 'id' to "foo.bar.baz.XAResourceAdapterImpl#1" and the 'ids' collection to:
{noformat}
ids = {java.util.Collections$UnmodifiableSet at 7199} size = 7
[0] = {java.lang.String at 7287}"foo.bar.RAImpl#2"
[1] = {java.lang.String at 7202}"foo.bar.XARAImpl#1"
[2] = {java.lang.String at 7288}"foo.bar.NoTxRAImpl#1"
[3] = {java.lang.String at 7289}"foo.bar.XARAImpl#2"
[4] = {java.lang.String at 7290}"foo.bar.TxImpl#1"
[5] = {java.lang.String at 7291}"foo.bar.NoTxRAImpl#2"
[6] = {java.lang.String at 7292}"foo.bar.LocalTxRAImpl#1"
{noformat}
Maybe I did not understand the code above correctly, but to me it seems to be a bug.
was:
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 tests fail in deployment phase due to:
{noformat}
Caused by: java.lang.IllegalStateException: JBAS014332: found more than one RA registered as app-rar
at org.jboss.as.ejb3.component.EJBUtilities.createActivationSpecs(EJBUtilities.java:126)
{noformat}
But it seems that tests are configured and packaged right and there really is only one rar deployment with name 'app-rar'. 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 test case, at the line marked above the 'packageName' is equal to "foo.bar", the 'id' to "foo.bar.baz.XAResourceAdapterImpl#1" and the 'ids' collection to:
{noformat}
ids = {java.util.Collections$UnmodifiableSet at 7199} size = 7
[0] = {java.lang.String at 7287}"foo.bar.RAImpl#2"
[1] = {java.lang.String at 7202}"foo.bar.XARAImpl#1"
[2] = {java.lang.String at 7288}"foo.bar.NoTxRAImpl#1"
[3] = {java.lang.String at 7289}"foo.bar.XARAImpl#2"
[4] = {java.lang.String at 7290}"foo.bar.TxImpl#1"
[5] = {java.lang.String at 7291}"foo.bar.NoTxRAImpl#2"
[6] = {java.lang.String at 7292}"foo.bar.LocalTxRAImpl#1"
{noformat}
Maybe I did not understand the code above correctly, but to me it seems to be a bug.
> 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. According to the AS server.log, the tests fail in deployment phase due to:
> {noformat}
> Caused by: java.lang.IllegalStateException: JBAS014332: found more than one RA registered as app-rar
> at org.jboss.as.ejb3.component.EJBUtilities.createActivationSpecs(EJBUtilities.java:126)
> {noformat}
> But it seems that tests are configured and packaged right and there really is only one rar deployment with name 'app-rar'. 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 test case, at the line marked above the 'packageName' is equal to "foo.bar", the 'id' to "foo.bar.baz.XAResourceAdapterImpl#1" and the 'ids' collection to:
> {noformat}
> ids = {java.util.Collections$UnmodifiableSet at 7199} size = 7
> [0] = {java.lang.String at 7287}"foo.bar.RAImpl#2"
> [1] = {java.lang.String at 7202}"foo.bar.XARAImpl#1"
> [2] = {java.lang.String at 7288}"foo.bar.NoTxRAImpl#1"
> [3] = {java.lang.String at 7289}"foo.bar.XARAImpl#2"
> [4] = {java.lang.String at 7290}"foo.bar.TxImpl#1"
> [5] = {java.lang.String at 7291}"foo.bar.NoTxRAImpl#2"
> [6] = {java.lang.String at 7292}"foo.bar.LocalTxRAImpl#1"
> {noformat}
> Maybe I did not understand the code above correctly, but to me it seems to be a bug.
--
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
More information about the jboss-jira
mailing list