[weld-dev] NPE on AbstractResourceInjection

Emily Jiang emijiang6 at googlemail.com
Mon Aug 10 12:28:05 EDT 2015


Thanks Jozef and Martin! I did find out it returns a null sometimes and are
fixing that. Yep. It will be good not to throw NPE.
Emily

On Mon, Aug 10, 2015 at 4:38 PM, Jozef Hartinger <jharting at redhat.com>
wrote:

> After a quick look it seems that your ResourceInjectionServices
> implementation returns null sometimes from the
> registerResourceInjectionPoint() method? Is that possible? I'll add checks
> to Weld to validate the preconditions upfront instead of run time.
>
> Jozef
>
>
> On 4.8.2015 10:19, Emily Jiang wrote:
>
>> How can I verify whether the ResourceInjectionServices implemented
>> properly? I can verify it was called for other CDI bean resource
>> injection but not by ManagedBean resource injections.
>> Thanks
>> Emily
>>
>> On Tue, Aug 4, 2015 at 8:58 AM, Martin Kouba <mkouba at redhat.com
>> <mailto:mkouba at redhat.com>> wrote:
>>
>>     Hi Emily,
>>
>>     do you have ResourceInjectionServices implemented properly?
>>
>>     Martin
>>
>>     Dne 4.8.2015 v 00:37 Emily Jiang napsal(a):
>>
>>         I am trying to use Weld to inject ManagedBean instance but got the
>>         following NPE.
>>         [javatest.batch] Caused by: java.lang.NullPointerException
>>         [javatest.batch]        at
>>
>> org.jboss.weld.injection.AbstractResourceInjection.getResourceReference(AbstractResourceInjection.java:44)
>>         [javatest.batch]        at
>>
>> org.jboss.weld.injection.AbstractResourceInjection.injectResourceReference(AbstractResourceInjection.java:53)
>>         [javatest.batch]        at
>>         org.jboss.weld.util.Beans.injectEEFields(Beans.java:348)
>>         [javatest.batch]        at
>>
>> org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:69)
>>         --
>>
>>         Is there anything wrong? For some reason, it does not call back
>>         to the
>>         ResourceReferenceFactory service to get hold of an instance of
>>         an factory.
>>         Thanks
>>         Emily
>>         =================
>>         Emily Jiang
>>         ejiang at apache.org <mailto:ejiang at apache.org>
>>         <mailto:ejiang at apache.org <mailto:ejiang at apache.org>>
>>
>>
>>         _______________________________________________
>>         weld-dev mailing list
>>         weld-dev at lists.jboss.org <mailto:weld-dev at lists.jboss.org>
>>         https://lists.jboss.org/mailman/listinfo/weld-dev
>>
>>
>>     --
>>     Martin Kouba
>>     Software Engineer
>>     Red Hat, Czech Republic
>>
>>
>>
>>
>> --
>> Thanks
>> Emily
>> =================
>> Emily Jiang
>> ejiang at apache.org <mailto:ejiang at apache.org>
>>
>>
>> _______________________________________________
>> weld-dev mailing list
>> weld-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/weld-dev
>>
>>


-- 
Thanks
Emily
=================
Emily Jiang
ejiang at apache.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20150810/b3d19a0a/attachment.html 


More information about the weld-dev mailing list