diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java index 9ee0bb23d5..7488163ebe 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java @@ -872,7 +872,14 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active JSONArray txDetailListJson = new JSONArray(); for (Map.Entry entry : xidsSortedByCreationTime) { Xid xid = entry.getKey(); - TransactionDetail detail = new CoreTransactionDetail(xid, resourceManager.getTransaction(xid), entry.getValue()); + + Transaction tx = resourceManager.getTransaction(xid); + + if (tx == null) { + continue; + } + + TransactionDetail detail = new CoreTransactionDetail(xid, tx, entry.getValue()); txDetailListJson.put(detail.toJSON()); } @@ -908,7 +915,14 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active for (Map.Entry entry : xidsSortedByCreationTime) { Xid xid = entry.getKey(); - TransactionDetail detail = new CoreTransactionDetail(xid, resourceManager.getTransaction(xid), entry.getValue()); + + Transaction tx = resourceManager.getTransaction(xid); + + if (tx == null) { + continue; + } + + TransactionDetail detail = new CoreTransactionDetail(xid, tx, entry.getValue()); JSONObject txJson = detail.toJSON();