K
Karl Krukow
Hello,
I'm writing a Java Security Manager extension, and in the process, I've
run into a problem that I've never seen before.
The code installs a security manager, and then runs a test-program under
the manager. Basically, the problem is that I'm getting a
ClassCircularityError at runtime:
Exception in thread "main" java.lang.ClassCircularityError:
InductiveQSemantics
at ArrayBasedDMC.New(ArrayBasedDMC.java:49)
at QSecMan.checkPermission(QSecMan.java:48)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
....
Now, as far as I understand, a class circularity occurs in a class
"hierarchy" where a class A is a subclass of class B and at the same
time class B is a subclass of class A. Now, normally, the compiler would
ensure that all classes used are cycle-free, so this should be detected
at compile-time. The apparent problem-class "InductiveQSemantics" does
extend another class, but not vice-versa (then the compiler would have
noticed).
I'm not sure that this is important, but note that I'am not using
reflection (at least not directly) in my code, though library code may
use it - but those shouldn't load my classes?
I'm also not sure if this is a bug in the VM, or my code is somehow
flawed. What I would like to know is whether this could be an instance
of a known bug. I tried to trace the bug on bugs.sun.com - and it may be
related to the bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4670071
But, I'm really not sure-
Any "expert" help would be appreciated ;-) Regards,
- Karl
(NB. X-posted to comp.lang.programmer)
I'm writing a Java Security Manager extension, and in the process, I've
run into a problem that I've never seen before.
The code installs a security manager, and then runs a test-program under
the manager. Basically, the problem is that I'm getting a
ClassCircularityError at runtime:
Exception in thread "main" java.lang.ClassCircularityError:
InductiveQSemantics
at ArrayBasedDMC.New(ArrayBasedDMC.java:49)
at QSecMan.checkPermission(QSecMan.java:48)
at java.lang.SecurityManager.checkRead(SecurityManager.java:871)
....
Now, as far as I understand, a class circularity occurs in a class
"hierarchy" where a class A is a subclass of class B and at the same
time class B is a subclass of class A. Now, normally, the compiler would
ensure that all classes used are cycle-free, so this should be detected
at compile-time. The apparent problem-class "InductiveQSemantics" does
extend another class, but not vice-versa (then the compiler would have
noticed).
I'm not sure that this is important, but note that I'am not using
reflection (at least not directly) in my code, though library code may
use it - but those shouldn't load my classes?
I'm also not sure if this is a bug in the VM, or my code is somehow
flawed. What I would like to know is whether this could be an instance
of a known bug. I tried to trace the bug on bugs.sun.com - and it may be
related to the bug:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4670071
But, I'm really not sure-
Any "expert" help would be appreciated ;-) Regards,
- Karl
(NB. X-posted to comp.lang.programmer)