java.lang.IllegalAccessError with correctly compiled code


I have a problem with EBuild for Java.

I was not able to create a test case. Looks like the problem occurs only in case of big source files.

exception in thread “main” java.lang.IllegalAccessError: tried to access method neo.CNeoPrimaryComponentBase.supercoreIn
tercept(ILjava/lang/String;Ljava/lang/Object;)V from class sbb.neo.CCertificateManager$2
at sbb.neo.CCertificateManager$2.do_Generate$GenerateSelfSigned()
at sbb.neo.CCertificateManager.do_Generate()
at sbb.Certificatemanager.generate(Unknown Source)
at sbb.test.CertificateManagerTest.RunTest()
at sbb.test.__Global.main()

CCertificateManager.do_Generate() has inner procedure GenerateSelfSigned() that calls supercoreIntercept() method. supercoreIntercept() method is defined as protected in CCertificateManager parent class: neo.CNeoPrimaryComponentBase.

Compiler generates two class files:

  1. public class sbb.neo.CCertificateManager extends neo.CNeoPrimaryComponentBase

  2. final class sbb.neo.CCertificateManager$2 {
    public sbb.neo.CCertificateManager $self;

I’ve decompiled CCertificateManager$2.do_Generate$GenerateSelfSigned() method and saw next code:

this.$self.supercoreIntercept(…), but supercoreIntercept() is a protected method from another package and looks like this is the reason of the exception.

Best regards,
Vsevolod Ievgiienko

Do you have a testcase that shows this?

Unfortunately I was not able to reproduce the problem in a test case.

Attached file should reproduce the problem, but the compiler doesn’t split TChild class as for original code in our project.

SecureBlackbox.Test.pas (701 Bytes)

My guess is that the compiler splits the class only in case of “big” source file. Looks like a workaround for .class files size limitation.

CCertificateManager class in not a big one, but its located in .pas file that is ~7100 lines long.

It’s not going to be line related but probably could it be that class is spread more than 1 file?

No its located in a single file.

any chance of a testcase then? I can keep it private if needed but it’s quite tricky to reproduce otherwise.

Hi Carlo - I’ve sent a test case to you by e-mail. Thanks!


Thanks, logged as bugs://82958

bugs://82958 got closed with status fixed.