[jboss-jira] [JBoss JIRA] (AS7-3305) java.lang.IllegalAccessError when invoking protected method from another class in the same package path but different jar.

Tomas Gustavsson (JIRA) jira-events at lists.jboss.org
Thu Mar 8 04:12:37 EST 2012


    [ https://issues.jboss.org/browse/AS7-3305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12675024#comment-12675024 ] 

Tomas Gustavsson commented on AS7-3305:
---------------------------------------

I agree. It is natural to have a common utility jar in ear/lib, which is accessed by the modules deployed as ejb-jars and wars. Using protected methods there has worked fine for us in jboss 4, 5, 6 and glassfish 2. Does not work anymore in jboss 7.
                
> java.lang.IllegalAccessError when invoking protected method from another class in the same package path but different jar.
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: AS7-3305
>                 URL: https://issues.jboss.org/browse/AS7-3305
>             Project: Application Server 7
>          Issue Type: Bug
>          Components: Class Loading
>    Affects Versions: 7.1.0.CR1b
>         Environment: Windows 7 64 bit, Sun JDK 1.6.0_30 32bit
>            Reporter: Rodney Kite
>            Assignee: Stuart Douglas
>
> 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.    

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list