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

Misleading error message when Extension observer method is (wrongly) static


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 3.0.0.CR2, 2.4.3.Final
    • 3.0.0.Beta1
    • Extensions
    • None

      The root cause of this bug is definitely pilot error, but read on.

      If you have a lifecycle event method in an Extension, and you inadvertently make it static, then the error message you get is this:

      org.jboss.weld.exceptions.IllegalStateException: WELD-000143: Container lifecycle event method invoked outside of extension observer method invocation.

      It was not at all immediately apparent that the only problem I had was that the method was static. It would be very helpful if this condition could be probed a bit and a better error message delivered.

            asabotdu@redhat.com Antoine Sabot-Durand (Inactive)
            ljnelson+github@gmail.com Laird Nelson
            0 Vote for this issue
            2 Start watching this issue