Uploaded image for project: 'Weld'
  1. Weld
  2. WELD-870

Add injection point information to exception message when injection into observer fails

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 1.1.1.Final
    • 1.1.0.Final
    • Events
    • None

      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.

              ajustin@redhat.com Ales Justin
              dan.j.allen Dan Allen (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: