TransactionContext class cast exception
---------------------------------------
Key: AMQ-1088
URL: https://issues.apache.org/activemq/browse/AMQ-1088
Project: ActiveMQ
Issue Type: Bug
Components: Connector
Affects Versions: 4.0.1
Environment: XP - jre 1.4
Reporter: Mary Nicholas
Priority: Minor
The class org.apache.activemq.TransactionContext throws a class cast exception
on the recover(int flag) method on the line (or at least it does with jdk1.4)
return (XATransactionId[]) receipt.getData();
It cannot cast the list of DataStructure[] to XATransactionId[]. I just
unpacked it locally as a fix (as seen below) and it worked fine. Have not
checked it in though in case others with more experience on this one disagree.
DataStructure[] x = receipt.getData();
if (x.length > 0)
{
XATransactionId xaId[] = new XATransactionId[x.length];
int count = 0;
for (count =0; count < x.length; count++)
xaId[count] = (XATransactionId)x[count];
return xaId;
}
else
return null;
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira