• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.IllegalAccessError: class A cannot access its superclass B  RSS feed

 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends

I'm having a problem getting on with an existing tool that would just not work kindly!

Being in a fighting process with this tool, I have managed somehow in getting it to run partially, but there are still remaining problems.

Well today's problem is called "java.lang.IllegalAccessError: class A cannot access its superclass B"

I feel I understand what the problem is... Class B is somehow protected from being access by class A! Now, if B was protected by making it private then the compiler should have caught that. But my problem arises during run time execution.
Both classes A & B are in the same package! And having looked at the code I can't see where B might have been protected .

Note: I am running the tool on Java 1.4 (yes! An old and dusted version of Java, but I have no choice other wise the tool experiences state explosion problem on Java 5 & 6!)

Any advice, ideas, suggestions... my mind is open to try anything!!

Thanks
HannaH
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please supply more details. Which tool? Which folders/jars/packages are the two classes in? Do you have access to those directories etc? Are you attempting to gain access to private members? Has anybody recompiled the superclass since it was created?
 
H Melua
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Campbell..

My tool is called LTSA version 2.3.

I am attempting to run the following command line "C:\j2re1.4.1_07\bin\java -cp .;lib\framework.jar;lib\ltsa.jar com.chatley.magicbeans.PluginManager ltsa.mb"

Both classes are in the ltsa.jar and in particular in a package called ic.doc.ltsa.lts;

The class was written in Java 5 source code, but was compiled in 1.4 compiler.

Class A overrides one of the *public* methods in its superclass B, and adds 3 move public methods. Class B does have private methods but those private methods are not called from A.

You may want to look at the code... you'll find A here A.java

and B here B.java

Both source codes are decompiled from the class originally compiled using the 1.4 compiler.

Thanks a lot
HannaH
 
Campbell Ritchie
Marshal
Posts: 56541
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't know, I am afraid. Is there a newer version of the .jar available anywhere? Have you read the details of why that Error is thrown? It suggests something has gone wrong with the class after it was compiled, which is why I am asking about compiling. And why were those classes (which are written in old-fashioned Java anyway) compiled with an older JDK?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!