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

JNDIBean's create() method can fail with NoInitialContextException

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 5.9.5.Final
    • Fix Version/s: 5.9.6.Final
    • Component/s: JTA
    • Labels:
      None

      Description

      For background, see https://github.com/jbosstm/narayana/pull/1403#issuecomment-479495649 and following.

      Briefly, in the CDI integration area of ArjunaJTA/cdi, JNDIBean attempts to create an InitialContext. In application server scenarios, the relevant metadata to permit this to happen will exist, and there won't be any issues (so Wildfly etc. are fine here). In CDI SE, it is possible that such metadata won't exist, and a NoInitialContextException will be thrown.

      NarayanaTransactionManager uses a similar strategy, but correctly prevents NoInitialContextExceptions from being thrown (https://github.com/jbosstm/narayana/blob/54b60a4db37ca859b9742d5f6f25cc828312ab4c/ArjunaJTA/cdi/classes/com/arjuna/ats/jta/cdi/NarayanaTransactionManager.java#L181).

      The proper solution is to ensure that a TransactionSynchronizationRegistry bean is set up in a similar manner to NarayanaTransactionManager.

      I'll have a pull request to fix this shortly.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ljnelson Laird Nelson
                Reporter:
                ljnelson Laird Nelson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: