Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-645

InjectionPoint is null when using @Produces. NullPointerException caused by CDI container providing a null InjectionPoint into a producer method.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0.0, 1.1.0, 1.1.2, 1.1.3
    • 1.1.4
    • Core
    • any platform

    Description

      The CDI container must provide a bean with scope @Dependent, bean type InjectionPoint and qualifier @Default, allowing dependent beans to obtain information about the injection point
      to which they belong. In certain circumstances this InjectionPoint is null or returns the wrong information about the injection point to which they belong.

      This is a two part problem
      1. A bean with scope @Dependent may inject an instance of InjectionPoint and access metadata relating to the injection point to which it belongs. This instance of InjectionPoint is
      null when the @Inject of the dependent bean is in an EJB.
      2. CDI container uses ThreadLocals to track the current InjectionPoint. When multiple injection points are interleaved, the CDI container does not correctly track the state of of the
      InjectionPoint's such that sometimes the most deeply nested InjectionPoint would still be on the thread local when it shouldn't be.

      The fix to the second problem is remedied by keeping a stack of injection points.
      The fix has MAY now cause the InjectionPoint to be null in cases where earlier we wouldn't have before.

      CDI container needs to be fixed to handle InjectionPoint injections in Producer methods and interleaved injections.

      See Reference: http://www-01.ibm.com/support/docview.wss?uid=swg1PM51802

      Attachments

        Activity

          People

            kelapure Rohit Dilip Kelapure
            kelapure Rohit Dilip Kelapure
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 72h
                72h
                Remaining:
                Remaining Estimate - 72h
                72h
                Logged:
                Time Spent - Not Specified
                Not Specified