OpenEJB
  1. OpenEJB
  2. OPENEJB-1125

Injection of TransactionSynchronizationRegistry using @Resource

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.1.2
    • Fix Version/s: None
    • Component/s: container system
    • Labels:
      None
    • Environment:
      WinXP, Java 5

      Description

      Hello Everyone,

      I would like to get the TransactionSynchronizationRegistry injected.

      @Resource(name="java:comp/TransactionSynchronizationRegistry")
      private TransactionSynchronizationRegistry registry;

      but this does not work - with or without the "name" Attribute.

      Instead, I have to execute the following

      InitialContext ictx = new
      registry = (TransactionSynchronizationRegistry) ictx.lookup("java:comp/TransactionSynchronizationRegistry");

      The Message is as follows:

      WARN - Jar not loaded. classpath.ear. No provider available for resource-ref 'null' of type 'javax.transaction.TransactionSynchronizationRegistry' for 'CompensationTestImpl'.
      org.apache.openejb.OpenEJBException: No provider available for resource-ref 'null' of type 'javax.transaction.TransactionSynchronizationRegistry' for 'CompensationTestImpl'.
      at org.apache.openejb.config.AutoConfig.autoCreateResource(AutoConfig.java:1342)
      at org.apache.openejb.config.AutoConfig.getResourceId(AutoConfig.java:1335)
      at org.apache.openejb.config.AutoConfig.getResourceId(AutoConfig.java:1286)
      at org.apache.openejb.config.AutoConfig.processResourceRef(AutoConfig.java:799)
      at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:724)
      at org.apache.openejb.config.AutoConfig.deploy(AutoConfig.java:133)
      ....

      Best regards,
      Alexander

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexander
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development