What if we added some code to com.gliffy.confluencePlugin.cache.ConfluenceCache.get() which attempts to detect the error condition.
For example, if the key starts with 'IMAGE', we could attempt to cast the object to DiagramBean in a try/catch block. If the object is non-null AND we get the ClassCastException AND the object is in Fact a DiagramBean, we know that the cache has likely been corrupted with the old objects. We should be able to call the removeAll() method on the cCache object, hopefully cleaning everything up.
Since all this is happening in the 'ConfluenceCache' object, it will only be specific to the plugin.
Do you think that would work?
Just confirming the issue with the confluence cache. If you flush the gliffy cache through the confluence admin console after reinstalling it seems to fix the problem.
I'm not sure if there is any way to get the plugin to "cleanup after itself " but we can possible catch the ClassCastException that is caused by this problem and get the cache flushed at that point. The interesting part will be making this confluence specific only since it doesn't apply to the online version of gliffy.