[weld-issues] [JBoss JIRA] Commented: (WELD-870) Add injection point information to exception message when injection into observer fails

Ales Justin (JIRA) jira-events at lists.jboss.org
Wed Mar 23 12:00:58 EDT 2011


    [ https://issues.jboss.org/browse/WELD-870?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12591331#comment-12591331 ] 

Ales Justin commented on WELD-870:
----------------------------------

I've got two fix impls:
(a) https://github.com/alesj/core/tree/weld-870
(b) https://github.com/alesj/core/tree/weld-870-lite

When doing (a) I saw that I could just do (b).
But (a) also adds some other things, similar to why we have @Dispose as Bean,
so I didn't just throw it away.

Pete, Stuart, wdyt?


> Add injection point information to exception message when injection into observer fails
> ---------------------------------------------------------------------------------------
>
>                 Key: WELD-870
>                 URL: https://issues.jboss.org/browse/WELD-870
>             Project: Weld
>          Issue Type: Enhancement
>          Components: Events
>    Affects Versions: 1.1.0.Final
>            Reporter: Dan Allen
>            Assignee: Ales Justin
>
> Injections that fail when an observer method is invoked are massively hard to track down. Here's the information you get:
> org.jboss.weld.exceptions.IllegalArgumentException: WELD-001324 Argument bean must not be null
>    at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:714)
>    at org.jboss.seam.exception.control.HandlerMethodImpl.notify(HandlerMethodImpl.java:187)
>    at org.jboss.seam.exception.control.ExceptionHandlerDispatch.executeHandlers(ExceptionHandlerDispatch.java:128)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
>    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>    at java.lang.reflect.Method.invoke(Method.java:616)
>    at org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:305)
>    at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
>    at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
>    at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:299)
>    at org.jboss.weld.introspector.jlr.WeldMethodImpl.invokeOnInstance(WeldMethodImpl.java:188)
>    at org.jboss.weld.introspector.ForwardingWeldMethod.invokeOnInstance(ForwardingWeldMethod.java:59)
>    at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:198)
>    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:270)
>    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:253)
>    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:222)
>    at org.jboss.weld.manager.BeanManagerImpl.notifyObservers(BeanManagerImpl.java:632)
>    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:619)
>    at org.jboss.weld.manager.BeanManagerImpl.fireEvent(BeanManagerImpl.java:613)
> I expect to see the type and qualifiers at the failing injection point. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the weld-issues mailing list