On 7/15/2010 7:50 PM, Dag H. Wanvik wrote:
Looking at the stack trace again, it seems this happens because we are
trying to save a copy of the generated class file here:
DatabaseClasses#loadGeneratedClass:
:
} catch (VirtualMachineError vme) { // these may be beyond
saving, but fwiw
WriteClassFile(fullyQualifiedName, classDump, vme);
Normally we don't try to write the generated classfile to disk, so
that's why we see the security exception, I presume.
The Javadoc for VirtualMachineError says:
"Thrown to indicate that the Java Virtual Machine is broken or has run
out of resources necessary for it to continue operating. "
so maybe my machine was out of resources.
It seems when a permission error occurs on the write, we lose the
VirtualMachineError. It seems we need a priv block for
WriteClassFile. Then if we still get a permissions error, we should
make sure the VirtualMachineError is the one thrown or use initCause()
to get both exceptions. I would think also the permissions to dump the
class in such dire circumstances should be documented. I guess it would
be optional but highly recommended.