Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-4013

com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple illegally calls initCause on a RemoteException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 7.2.2.Final
    • JTS
    • None

      I observed this in the server log of a WildFly CI run (https://ci.wildfly.org/viewLog.html?buildId=523078&buildTypeId=WF_PullRequest_LinuxSmJdk17&tab=buildResultsDiv)

      Caused by: java.lang.IllegalStateException: Can't overwrite cause with org.omg.CosTransactions.InvalidControl: IDL:omg.org/CosTransactions/InvalidControl:1.0
      	at java.base/java.lang.Throwable.initCause(Throwable.java:463)
      	at org.jboss.jts@7.2.2.Final//com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.resume(TransactionManagerImple.java:153)
      	at org.jboss.jts.integration@7.2.2.Final//com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.resume(BaseTransactionManagerDelegate.java:113)
      	at org.wildfly.transaction.client@3.0.5.Final//org.wildfly.transaction.client.LocalTransaction.resume(LocalTransaction.java:253)
      	at org.wildfly.transaction.client@3.0.5.Final//org.wildfly.transaction.client.ContextTransactionManager.resume(ContextTransactionManager.java:158)
      	at org.wildfly.transaction.client@3.0.5.Final//org.wildfly.transaction.client.ContextTransactionManager.resume(ContextTransactionManager.java:150)
      	at org.jboss.as.ejb3@38.0.0.Final-SNAPSHOT//org.jboss.as.ejb3.tx.CMTTxInterceptor.safeResume(CMTTxInterceptor.java:303)
      	... 73 more
      Caused by: jakarta.transaction.InvalidTransactionException
      	at org.jboss.jts@7.2.2.Final//com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple.resume(TransactionManagerImple.java:152)
      	... 78 more
      

      The problematic code is this in TransactionManagerImple:

                      InvalidTransactionException invalidTransactionException = new InvalidTransactionException();
                      invalidTransactionException.initCause(e1);
      

      InvalidTransactionException is a subclass of RemoteException, which explicitly disables the ability to call initCause by setting the cause (to null) in its own constructor:

          public RemoteException() {
              initCause(null);  // Disallow subsequent initCause
          }
      

      Unfortunately, invalidTransactionException doesn't expose a constructor that allows passing in the cause that way. (At least not in this version; IIRC Jakarta Transactions recently changed that for EE 12.)

      Note: I don't know if this has anything to do with the linked test failing. I doubt it as this looks like a problem in dealing with an error condition the test is not trying to create. So the original error condition would likely have caused some problem on its own.

              Unassigned Unassigned
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: