You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2019/10/29 16: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=16962151#comment-16962151 ] 

Justin Bertram commented on ARTEMIS-2532:
-----------------------------------------

Why not simply use the {{public}} field {{errorCode}} from {{XAException}} if you want to know why the exception was caused?

> XAException message should contain the errorCode
> ------------------------------------------------
>
>                 Key: ARTEMIS-2532
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2532
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    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)