Uploaded image for project: 'iBatis for Java [READ ONLY]'
  1. iBatis for Java [READ ONLY]
  2. IBATIS-595

IllegalAccessException if a default-method is called in Lazy-Loaded Proxy objects

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.4
    • 2.3.5
    • Core
    • None

    Description

      We are using the iBatis enhanced (cglib) proxy for lazy loading our bean
      references. One of these returned-proxied object is accessing a
      default-modifier method of another class in the same package. The code compiles
      without error but running it throws an IllegalAccessException thrown from the
      CGLIB-Proxy as it tries to invoke a non-public (default or protected) method
      from a different package.

      I wrote a test case for this problem (see attached patch).

      There is a solution (at least for default-modifier methods) for this problem
      using cglib LazyLoader callbacks. This is a replacement for the invocation handler
      which also has the advantage of increasing the performance of proxied objects
      as no methods are intercepted. This solution is contained in the attached
      patch. Unfortunately cglib handles protected methods differently to default so
      this solutions does not work with protected method calls.

      Attachments

        1. lazy-loader-test.patch
          4 kB
          Stefan Gmeiner
        2. lazy-loader.patch
          3 kB
          Stefan Gmeiner

        Activity

          People

            Unassigned Unassigned
            steff Stefan Gmeiner
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: