[GLASSFISH-19317] Injection of @PersistenceContext and @Resource in EAR's lib CDI beans does not work Created: 10/Nov/12  Updated: 08/Apr/13  Resolved: 08/Apr/13

Status: Resolved
Project: glassfish
Component/s: cdi
Affects Version/s:
Fix Version/s: 4.0_b84_RC1

Type: Bug Priority: Major
Reporter: titmus Assignee: jjsnyder83
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Windows 7 64bit, JDK 1.6.0_29 32bit

Attachments: Zip Archive jee-resources.zip    


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:

I attached a test case which demonstrates this bahaviour.

Comment by jjsnyder83 [ 08/Apr/13 ]

Committed revision 61234.

Generated at Thu Dec 08 17:10:29 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.