IllegalAccessError in generated class

B

Bryan Kennedy

I'm currently working on a project using BCEL to instrument classes as
they are loaded. I'm running into the following exception (stack
trace at the bottom of this post):

Exception in thread "main" java.lang.IllegalAccessError: class
sun.reflect.GeneratedSerializationConstructorAccessor1 cannot
access its superclass
sun.reflect.SerializationConstructorAccessorImpl

This error seems totally bizzare to me, since it looks like
MethodAccessGenerator is generating a bogus class. Some googling
around finds other people who have had this problem when using
programs like cactus, but I can't find anywhere that talks about how
those errors were resolved. Does anybody know what causes the bowels
of the sun.reflect API to generate a bogus class like this?

thanks for any help or pointers to resources that I missed.

--bk


a more full stack trace:
Exception in thread "main" java.lang.IllegalAccessError: class
sun.reflect.GeneratedSerializationConstructorAccessor1 cannot access
its superclass sun.reflect.SerializationConstructorAccessorImpl
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)
at
sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator
.java:381)
at java.security.AccessController.doPrivileged(Native Method)
at
sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator
.java:377)
at
sun.reflect.MethodAccessorGenerator.generateSerializationConstructor
(MethodAccessorGenerator.java:95)
at
sun.reflect.ReflectionFactory.newConstructorForSerialization
(ReflectionFactory.java:301)
at
java.io_ObjectStreamClass.getSerializableConstructor
(ObjectStreamClass.java:1177)
at
java.io_ObjectStreamClass.access$1100(ObjectStreamClass.java:45)
at java.io_ObjectStreamClass$3.run(ObjectStreamClass.java:343)
at java.security.AccessController.doPrivileged(Native Method)
at
java.io_ObjectStreamClass.<init>(ObjectStreamClass.java:329)
at
java.io_ObjectStreamClass.lookup(ObjectStreamClass.java:249)
at
java.io_ObjectOutputStream.writeObject0(ObjectOutputStream.java:1010)
at
java.io_ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top