You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Viliam Durina (Jira)" <ji...@apache.org> on 2019/11/01 23:05:00 UTC
[jira] [Commented] (ARTEMIS-2532) XAException message should
contain the errorCode
[ https://issues.apache.org/jira/browse/ARTEMIS-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16965140#comment-16965140 ]
Viliam Durina commented on ARTEMIS-2532:
----------------------------------------
I'm working on a generic JMS connector for Hazelcast Jet. I'm using Artemis only in tests. I did the above workaround because I needed to see the error code and it will not harm other XA implementations our users might use - it engages only if the message is empty.
I agree that {{javax.transaction.xa.XAException}} is badly designed and it's not your fault. I should probably file an issue there too. But Artemis doesn't have to use a badly designed piece of code from JDK - we can extend it and add the error code to the message too. I might try do the PR but I can't promise it.
> XAException message should contain the errorCode
> ------------------------------------------------
>
> Key: ARTEMIS-2532
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2532
> Project: ActiveMQ Artemis
> Issue Type: Wish
> Affects Versions: 2.10.1
> Reporter: Viliam Durina
> Priority: Major
>
> Plain {{javax.transaction.xa.XAException}} is thrown in multiple places. The version in JDK 8 and 11 contains no message and when printed, the {{errorCode}} isn't visible. For example:
> {noformat}
> javax.transaction.xa.XAException
> at org.apache.activemq.artemis.core.protocol.core.impl.ActiveMQSessionContext.xaCommit(ActiveMQSessionContext.java:492)
> at org.apache.activemq.artemis.core.client.impl.ClientSessionImpl.commit(ClientSessionImpl.java:1580)
> {noformat}
> This is maybe an issue of JDK, but Artemis has its own {{org.apache.activemq.artemis.core.exception.ActiveMQXAException}} which subclasses the default {{XAException}} and could fix the issue. The exception message should contain at least the error code, or ideally, the error name (e.g. {{XAER_NOTA}}).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)