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

Weld fails to invoke an observer method with a private access

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 3.0.2.Final
    • Fix Version/s: 3.0.3.Final, 2.4.7.Final
    • Component/s: Events
    • Labels:
      None
    • Environment:

      Weld 3.0.2 in Java SE 9.0.1

      Description

      Weld throws an IllegalAccessError when trying to invoke an observer method that is private. Changing the method access to package private, protected, or public solves the issue.

      I can hardly reproduce the problem. Some of my classes have private observer methods, and these methods are always invoked with success. Some other classes have also private observer methods and an IllegalAccessError is always thrown.

      With Weld 2.x I did not have this problem.

      Example of exception:
      java.lang.IllegalAccessError: tried to access method steappe.production.infra.PresentationCache.onEvent(Lsteappe/production/event/ProductionQueueEnumerated;)V from class steappe.production.infra.PresentationCache$Proxy$_$$_WeldSubclass

      The method is annotated as follows:
      private void onEvent(@Observes @PresentationLayer ProductionQueueEnumerated event)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                mkouba Martin Kouba
                Reporter:
                steappe St├ęphane Appercel
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: