IBM Support

PI47475: A NameNotFoundException occurs for injection of resource into Ma nagedBean in EJB module

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • An exception like the following may ocurr during resource
    injection of
    a ManagedBean in an EJB module even though the resource
    reference name
    matches the name of a resource in server.xml :
    javax.naming.NameNotFoundException:
    java:comp/env/jdbc/LibertyDb2
    com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupO
    bjec
    tFactory
    167
    followed by an exception like :
    com.ibm.wsspi.injectionengine.InjectionException:
    CWNEN1003E:
    The
    server was unable to find the java:comp/env/jdbc/LibertyDb2
    binding with
    the javax.sql.DataSource type for the
    java:comp/env/jdbc/LibertyDb2
    reference.
    com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionO
    bjec
    t 408
    

Local fix

  • Adding an identical @Resource injection for reportingDS to the
    Launcher EJB.
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server Liberty Profile - ManagedBean        *
    *                  Feature                                     *
    ****************************************************************
    * PROBLEM DESCRIPTION: A NameNotFoundException occurs for      *
    *                      injection of resource into ManagedBean  *
    *                      in EJB module when a binding is not     *
    *                      provided                                *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    An exception like the following may occur during resource
    injection of a ManagedBean in an EJB module even though the
    resource reference name matches the name of a resource in
    server.xml :
    
    javax.naming.NameNotFoundException:
    java:comp/env/jdbc/LibertyDb2
    com.ibm.ws.injectionengine.osgi.internal.IndirectJndiLookupObjec
    tFactory167
    
    followed by an exception like :
    com.ibm.wsspi.injectionengine.InjectionException: CWNEN1003E:
    The server was unable to find the java:comp/env/jdbc/LibertyDb2
    binding with the javax.sql.DataSource type for the
    java:comp/env/jdbc/LibertyDb2 reference.
    com.ibm.wsspi.injectionengine.InjectionBinding.getInjectionObjec
    t 408
    

Problem conclusion

  • Resource injection processing for ManagedBeans located in an EJB
    module has been updated to work the same way as ManagedBeans
    located in a WAR module. If a binding is not provided in an ibm-
    *-bnd.xml file then a resource defined by the same name for the
    servlet or EJB that obtains the ManagedBean will be used. If a
    resource by the same name does not exist for the component using
    the ManagedBean, then a resource defined in server.xml with the
    same name as the resource defined on the ManagedBean will be
    used.
    
    The fix for this APAR is currently targeted for inclusion in fix
    pack 8.5.5.8.  Please refer to the Recommended Updates page for
    delivery information:
    http://www.ibm.com/support/docview.wss?rs=180&uid=swg27004980
    

Temporary fix

  • There are two workarounds for this problem:
    1 - Define a resource by the same name in the referencing EJB.
    2 - Provide a binding for the resource in the ibm-managed-bean-
    bnd.xml file.
    

Comments

APAR Information

  • APAR number

    PI47475

  • Reported component name

    WAS LIBERTY COR

  • Reported component ID

    5725L2900

  • Reported release

    855

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2015-08-24

  • Closed date

    2015-09-16

  • Last modified date

    2015-09-16

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

    PI46631

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

Fix information

  • Fixed component name

    WAS LIBERTY COR

  • Fixed component ID

    5725L2900

Applicable component levels

  • R855 PSY

       UP

[{"Business Unit":{"code":"BU053","label":"Cloud \u0026 Data Platform"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"855","Line of Business":{"code":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
17 October 2021