]
Tom Jenkinson updated JBTM-2767:
--------------------------------
Summary: JCA inflowed JTS transactions can throw NPE (was: JTS: EIS can't recover
transaction when heuristic outcome happens)
JCA inflowed JTS transactions can throw NPE
-------------------------------------------
Key: JBTM-2767
URL:
https://issues.jboss.org/browse/JBTM-2767
Project: JBoss Transaction Manager
Issue Type: Bug
Components: JTS
Affects Versions: 5.3.5.Final
Reporter: Ondra Chaloupka
Assignee: Tom Jenkinson
Priority: Minor
I hit a trouble similar to JBEAP-5638 but in this case for {{JTS}}. I'm not able to
recover heuristic transaction for scenario
{quote}
* test client sends prepare command
* test client sends commit command
* first XAResource commits, secondXAResource throws {{XAException#XAER_RMERR}} on commit
start
* test client gets error code {{XAException#XA_HEURMIX}}
* now the transaction participant is in heuristic state
* tried to commit the created txn -> fails as in heuristic and can't be operated
* using {{:recover}} command for the transaction participant
* tried to commit the txn -> expecting the commit succeed and txn is committed
{quote}
There are two troubles. First is {{NullPointerException}} is thrown during a try to
commit transaction in heuristic state [1].
Second is not possible to read transaction participant from object store via
{{jboss-cli}} commands (even when {{expose-all-logs}} is used) and that way it's not
possible to call {{recover}} the participant in heuristic state.
[1]
{code}
2016-10-05 16:19:23,537 ERROR [stderr] (default-threads - 1)
java.lang.NullPointerException2016-10-05 16:19:23,537 ERROR [stderr] (default-threads -
1)
at
com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.SubordinateAtomicTransaction.getXid(SubordinateAtomicTransaction.java:80)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1)
at
com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.TransactionImple.baseXid(TransactionImple.java:126)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1) at
com.arjuna.ats.internal.jta.transaction.jts.jca.TransactionImporterImple.getImportedTransaction(TransactionImporterImple.java:135)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1)
at
com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple.commit(XATerminatorImple.java:83)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1)
at org.jboss.as.test.jbossts.crashrec.jca.rar.TestResourceTxnWorkUnit.run(Unknown
Source)2016-10-05 16:19:23,537 ERROR [stderr] (default-threads - 1)
at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:223)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1)
at
org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1)
at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1)
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1)
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)2016-10-05
16:19:23,537 ERROR [stderr] (default-threads - 1)
at java.lang.Thread.run(Thread.java:745)2016-10-05 16:19:23,537 ERROR [stderr]
(default-threads - 1)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
2016-10-05 16:19:23,538 ERROR
[org.jboss.as.test.jbossts.crashrec.jca.rar.TestResourceTxnWorkUnit] (default-threads - 1)
Unspecified sever exception: java.lang.NullPointerException at
com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.TransactionImple.recover(TransactionImple.java:135)
at
com.arjuna.ats.internal.jta.transaction.jts.jca.TransactionImporterImple.getImportedTransaction(TransactionImporterImple.java:141)
at
com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple.commit(XATerminatorImple.java:83) at
org.jboss.as.test.jbossts.crashrec.jca.rar.TestResourceTxnWorkUnit.run(Unknown Source) at
org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:223)
at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) at
org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)
at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)
at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
{code}
[2]
{code}
[standalone@localhost:42042 /]
/subsystem=transactions/log-store=log-store:read-resource(recursive=true,
include-runtime=true)
{
"outcome" => "success",
"result" => {
"expose-all-logs" => false,
"type" => "default",
"transactions" => undefined
}
}
[standalone@localhost:42042 /]
/subsystem=transactions/log-store=log-store:write-attribute(name=expose-all-logs,
value=true)
{
"outcome" => "success",
"result" => undefined
}
[standalone@localhost:42042 /] /subsystem=transactions/log-store=log-store:probe()
{"outcome" => "success"}
[standalone@localhost:42042 /]
/subsystem=transactions/log-store=log-store:read-resource(recursive=true,
include-runtime=true)
{
"outcome" => "success",
"result" => {
"expose-all-logs" => true,
"type" => "default",
"transactions" => {
"0:ffff7f000001:3716dcba:57f50b7d:14" => {
"age-in-seconds" => undefined,
"id" => "0:ffff7f000001:3716dcba:57f50b7d:14",
"jmx-name" => undefined,
"type" => "Recovery/FactoryContact",
"participants" => undefined
},
"0:ffff7f000001:3716dcba:57f50b7d:28" => {
"age-in-seconds" => undefined,
"id" => "0:ffff7f000001:3716dcba:57f50b7d:28",
"jmx-name" => undefined,
"type" =>
"StateManager/BasicAction/TwoPhaseCoordinator/ArjunaTransactionImple/ServerTransaction/JCA",
"participants" => undefined
},
"0:ffff52e38d0c:c91:4140398c:0" => {
"age-in-seconds" => undefined,
"id" => "0:ffff52e38d0c:c91:4140398c:0",
"jmx-name" => undefined,
"type" => "RecoveryCoordinator",
"participants" => undefined
}
}
}
}
{code}