Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-1043

Private method observer is not working properly while processing second and next events

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.8
    • 1.1.9
    • Events
    • None

    Description

      I found a strange behavior while handling events by private methods. First event was processed successfully, but the next ones not.
      Look at the
      /org/apache/webbeans/event/ObserverMethodImpl.java:216
      isPrivateMethod is true, then accessible flag sets to true. This means that next time isPrivateMethod will be false even observer method has a private access . Invocation of such method will be the same as invocation of public methods, but invocation handler won't be invoked for private methods.
      In this situation proxy instance's method will be invoked, but not a method of the contextual bean instance.
      In my case I get a NPE when calling any injected bean methods (each injected beans are null inside assist proxy)

      Seems that this code should be changed:
      boolean isPrivateMethod = !observerMethod.isAccessible();

      Attachments

        Activity

          People

            struberg Mark Struberg
            exmortal V L
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: