You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Leonard Bouchet <le...@lajoiedelire.ch> on 2000/09/20 12:43:52 UTC

Re: classformaterror - help

thank you for your answer.

I'm using Sun JVM 1.0. I tried to call System.gc() from a jsp page, but it
doesn't change anything. Even if I restart, I have the problem.

How can I be sure that a class has been deleted, before I try to reload it?


> I don't think it has anything to do with the ResultSet thing. I'm
> doing something completely different and get the same sort of errors.
> 
> ClassFormatExceptions occur as a result of a Class's bytecode getting
> corrupted, e.g. because the file is damaged on your disk. They are not
> supposed to happen "just like that".
> 
> I recently posted a message describing a similar problem, observed
> while I was gradually but frequently improving on my code. I now think
> it's Tomcat's ClassLoader that's the problem. Or, to be more specific,
> Java's class loading mechanism that does not allow re-definition of a
> class. You cannot just dispose of a class in a running VM and load a
> new definition. You can, however, rely on the VM's garbage collector
> cleaning up a class when it is no longer used. Which is exactly what
> Tomcat's AdaptiveClassLoader does, as the comments in the sourcecode
> mention. So, my guess is that, when your VM's garbage collector does
> not clean up a class fast enough, you get ClassFormatExceptions when
> you try to load a new definition from disk. What VM are you using ?