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

Weld fails to invoke an observer method with a private access


    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.3.Final, 2.4.7.Final
    • 3.0.2.Final
    • Events
    • None

      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)

            mkouba@redhat.com Martin Kouba
            steappe St├ęphane Appercel (Inactive)
            0 Vote for this issue
            4 Start watching this issue