glassfish
  1. glassfish
  2. GLASSFISH-19317

Injection of @PersistenceContext and @Resource in EAR's lib CDI beans does not work

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2.2
    • Fix Version/s: 4.0_b84_RC1
    • Component/s: cdi
    • Labels:
      None
    • Environment:

      Windows 7 64bit, JDK 1.6.0_29 32bit

      Description

      When a CDI bean is defined in a bean archive located in lib directory of an EAR archive GF does not properly inject values into fields annotated with @PersistenceContext or @Resource annotation.
      The field is initalized with weld proxy but when a method is invoked on such field the NullInstanceException is raised: org.jboss.weld.exceptions.NullInstanceException: WELD-000044 Unable to obtain instance from null.

      I found this discussion which seems to describe exactly the same problem:
      http://www.java.net/forum/topic/glassfish/glassfish/persistencecontext-ignored-library-jar-classes?force=606

      I attached a test case which demonstrates this bahaviour.

        Activity

        Hide
        jjsnyder83 added a comment -

        Committed revision 61234.

        Show
        jjsnyder83 added a comment - Committed revision 61234.

          People

          • Assignee:
            jjsnyder83
            Reporter:
            titmus
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: