IBM Support

PI27924: USERTRANSACTION CANNOT BE USED FROM A CDI INSTANCE CREATED WITHIN THE CONTEXT OF AN EJB

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • @Resource UserTransaction not injectable into CDI bean when
    called by @Stateless EJB
    
    a @Stateless @WebService class using CDI based
    @ApplicationScoped @Transactional services
    when CDI based Service gets initialized from within the
    @Stateless @WebService  will fail with the UserTransaction in
    CDI beans being null.
    
    [10/13/14 15:55:49:564 CEST] 0000014d HybridUserTra >
    getObjectInstance
    Entry
    Reference Class Name:
    javax.transaction.UserTransaction
    
    <null>
    [10/13/14 15:55:49:564 CEST] 0000014d HybridUserTra <
    getObjectInstance
    :  Exit
    
    com.ibm.wsspi.injectionengine.InjectionException:
    UserTransaction may only be looked up by or injected into an
    EJB if that EJB is configured to use bean managed
    transactions.  EJB
    xxxx-ear-4.0.0.0#dev77-service.jar#xxxxxImpl is
    configured for container managed transactions.
    
    [10/13/14 15:55:49:569 CEST] 0000014d InjectionBind E
    CWNEN0030E: The @Resource factory encountered a problem
    getting the object instance
    xxxxx.xxxxxx.BeanManagedUserTransactionStrategy/userTransaction
    binding object.  The exception message was:
    UserTransaction may only be looked up by or injected into an EJB
    if that EJB is configured to use bean managed transactions.  EJB
    xxxxxxxxx is configured for container managed transactions.
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of Enterprise Java Beans (EJB)    *
    *                  and Context and Dependency Injection (CDI)  *
    *                  in IBM WebSphere Application Server V8.5    *
    ****************************************************************
    * PROBLEM DESCRIPTION: UserTransaction cannot be used from a   *
    *                      CDI bean created in the context of an   *
    *                      EJB.                                    *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    The injection of a UserTransaction object uses the same logic
    as lookup of a UserTransaction object.  Lookup of
    UserTransaction is prevented when it occurs within the context
    of an EJB that uses container-managed transactions, and the
    UserTransaction object returned within the context of an EJB
    that uses bean-managed transactions can only be used within
    the context of an EJB that uses bean-managed transactions.
    

Problem conclusion

  • The injection of a UserTransaction object has been
    changed to separate logic for injection, and the logic only
    applies restrictions when the object being created is an EJB
    rather than checking the current component context.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 8.5.5.5.  Please refer to the Recommended Updates
    page for delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

Comments

APAR Information

  • APAR number

    PI27924

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    850

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2014-10-17

  • Closed date

    2014-10-23

  • Last modified date

    2014-10-23

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    WEBSPHERE APP S

  • Fixed component ID

    5724J0800

Applicable component levels

  • R850 PSY

       UP

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"8.5","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
12 January 2022