Uploaded image for project: 'Application Server 7'
  1. Application Server 7
  2. AS7-3305

java.lang.IllegalAccessError when invoking protected method from another class in the same package path but different jar.

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Rejected
    • Affects Version/s: 7.1.0.CR1b
    • Fix Version/s: None
    • Component/s: Class Loading
    • Labels:
      None
    • Environment:

      Windows 7 64 bit, Sun JDK 1.6.0_30 32bit

    • Steps to Reproduce:
      Hide

      Have a Session bean call a protected method in a class that is in the same package path but in a different jar file from the ejb jar. The EJB jar and utility jar are in the same ear file.

      Show
      Have a Session bean call a protected method in a class that is in the same package path but in a different jar file from the ejb jar. The EJB jar and utility jar are in the same ear file.
    • Workaround Description:
      Hide

      Change methods to public fixes the issue.

      Show
      Change methods to public fixes the issue.

      Description

      tried to access method com.tis.utilities.AbstractJavaBeanSelectionPagination.selectObject(IZ)V from class com.tis.utilities.GenericPaginationBean

      I have an EJB jar which uses a MANIFEST.MF CLASS-PATH: entry to include a jar with some utility code. The two jars are packaged in the same ear file. Compiles and deploys fine. For some reason the EJB jar's classes can not invoke protected methods in classes that are in the same package path but in different jars. Invocation of public methods works fine. By the Java spec protected methods should be friends and thus accessible from other classes in the same package path.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                swd847 Stuart Douglas
                Reporter:
                rkite01 Rodney Kite
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: