-
Bug
-
Resolution: Done
-
Major
-
2.3.1.Final
-
None
-
None
This seems to be a regression/behavioural change from 2.2.6 (the last time I was trying this).
Scenario: I have an Arquillian test that is leveraging somewhere in its hierarchy an EntityManager. That entity manager is injected using @PersistenceContext. In Weld 2.2.6 that field would end up being null. In 2.3.1, that field is now throwing a Null Pointer Exception
java.lang.NullPointerException at org.jboss.weld.util.Preconditions.checkNotNull(Preconditions.java:51) at org.jboss.weld.injection.AbstractResourceInjection.<init>(AbstractResourceInjection.java:39) at org.jboss.weld.injection.FieldResourceInjection.<init>(FieldResourceInjection.java:48) at org.jboss.weld.injection.ResourceInjectionFactory$ResourceInjectionProcessor.createFieldResourceInjection(ResourceInjectionFactory.java:217) at org.jboss.weld.injection.ResourceInjectionFactory$ResourceInjectionProcessor.createResourceInjections(ResourceInjectionFactory.java:189) at org.jboss.weld.injection.ResourceInjectionFactory.discoverType(ResourceInjectionFactory.java:449) at org.jboss.weld.injection.ResourceInjectionFactory.getResourceInjections(ResourceInjectionFactory.java:97) at org.jboss.weld.injection.producer.ResourceInjector.<init>(ResourceInjector.java:59) at org.jboss.weld.injection.producer.ResourceInjector.of(ResourceInjector.java:49) at org.jboss.weld.injection.producer.BeanInjectionTarget.<init>(BeanInjectionTarget.java:63) at org.jboss.weld.injection.producer.BeanInjectionTarget.createDefault(BeanInjectionTarget.java:47) at org.jboss.weld.manager.InjectionTargetFactoryImpl.chooseInjectionTarget(InjectionTargetFactoryImpl.java:128) at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:87) at org.jboss.weld.bean.ManagedBean.<init>(ManagedBean.java:100) at org.jboss.weld.bean.ManagedBean.of(ManagedBean.java:80) at org.jboss.weld.bootstrap.AbstractBeanDeployer.createManagedBean(AbstractBeanDeployer.java:261) at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:228) at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:78) at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:75) at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63) at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
- is related to
-
ARQ-2000 MockResourceReferenceFactory.createResource() causes NullPointerException during resource injection
- Pull Request Sent