IBM Support

PI63955: NULLPOINTEREXCEPTION THROWN BY WELD WHEN INJECTING AN EJB INTO A CDI MANAGED BEAN

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • The following exception may occur for CDI managed beans that
    contain either @EJB or @Resource injection:
    
    Caused by: java.lang.NullPointerException
              at
    org.jboss.weld.injection.AbstractResourceInjection.getResourceRe
    ference(AbstractResourceInjection.java:48)
              at
    org.jboss.weld.injection.AbstractResourceInjection.injectResourc
    eReference(AbstractResourceInjection.java:53)
              at
    org.jboss.weld.util.Beans.injectEEFields(Beans.java:348)
              at
    org.jboss.weld.injection.producer.ResourceInjector$1.proceed(Res
    ourceInjector.java:69)
              at
    com.ibm.ws.cdi.impl.weld.injection.WebSphereInjectionServicesImp
    l$2.run(WebSphereInjectionServicesImpl.java:280)
              at
    com.ibm.ws.cdi.impl.weld.injection.WebSphereInjectionServicesImp
    l$2.run(WebSphereInjectionServicesImpl.java:277)
              at
    java.security.AccessController.doPrivileged(AccessController.jav
    a:594)
              at
    com.ibm.ws.cdi.impl.weld.injection.WebSphereInjectionServicesImp
    l.aroundInject(WebSphereInjectionServicesImpl.java:277)
              at
    org.jboss.weld.injection.InjectionContextImpl.run(InjectionConte
    xtImpl.java:46)
              at
    org.jboss.weld.injection.producer.ResourceInjector.inject(Resour
    ceInjector.java:72)
              at
    org.jboss.weld.injection.producer.BasicInjectionTarget.inject(Ba
    sicInjectionTarget.java:121)
              at
    org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:159)
              at
    org.jboss.weld.context.unbound.DependentContextImpl.get(Dependen
    tContextImpl.java:69)
              at
    org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextual
    InstanceStrategy.get(ContextualInstanceStrategy.java:101)
              at
    org.jboss.weld.bean.ContextualInstance.get(ContextualInstance.ja
    va:50)
              at
    org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerI
    mpl.java:761)
              at
    org.jboss.weld.injection.producer.AbstractMemberProducer.getRece
    iver(AbstractMemberProducer.java:129)
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:  All users of IBM WebSphere Application      *
    *                  Server with applications that use Contexts  *
    *                  and Dependency Injection (CDI) managed      *
    *                  beans                                       *
    ****************************************************************
    * PROBLEM DESCRIPTION: NullPointerException for CDI managed    *
    *                      beans with @EJB or @Resource injection  *
    ****************************************************************
    * RECOMMENDATION:                                              *
    ****************************************************************
    When an application contains a CDI managed bean with
    either @EJB or @Resource injection, then the following
    exception may occur:
    java.lang.NullPointerException
    at
    org.jboss.weld.injection.AbstractResourceInjection.getResourceRe
    ference(AbstractResourceInjection.java:48)
    at
    org.jboss.weld.injection.AbstractResourceInjection.injectResourc
    eReference(AbstractResourceInjection.java:53)
    at
    org.jboss.weld.util.Beans.injectEEFields(Beans.java:348)
    at
    org.jboss.weld.injection.producer.ResourceInjector$1.proceed(Res
    ourceInjector.java:69)
    at
    com.ibm.ws.cdi.impl.weld.injection.WebSphereInjectionServicesImp
    l$2.run(WebSphereInjectionServicesImpl.java:280)
    at
    com.ibm.ws.cdi.impl.weld.injection.WebSphereInjectionServicesImp
    l$2.run(WebSphereInjectionServicesImpl.java:277)
    

Problem conclusion

  • In the failing scenario, the managed bean container is
    incorrectly interpreting the CDI managed bean as an
    instance of a bean with the javax.annotation.ManagedBean and
    preventing the CDI managed bean from being created. The
    managed bean container has been corrected and will now
    properly identify and manage only beans with the
    javax.annotation.ManagedBean annotation. The
    NullPointerException will no longer occur.
    
    The fix for this APAR is currently targeted for inclusion in
    fix pack 9.0.0.1.  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

    PI63955

  • Reported component name

    WEBSPHERE APP S

  • Reported component ID

    5724J0800

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-06-10

  • Closed date

    2016-06-17

  • Last modified date

    2016-08-05

  • 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

  • R900 PSY

       UP

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

Document Information

Modified date:
15 October 2021