Login  Register

Re: Strange ClassCastException: A puzzle for Java/ImageJ experts to help me wit?.

Posted by Bill Mohler on Apr 29, 2009; 4:24pm
URL: http://imagej.273.s1.nabble.com/Strange-ClassCastException-A-puzzle-for-Java-ImageJ-experts-to-help-me-wit-tp3692688p3692697.html

Dscho, thanks for the suggestion, but I seem to be able to figure out
how to work your request for stack.getClass().getClassLoader() (I
can't figure a way to get the class loader for mqtvsClass...)

Here's what prints for stack.getClass().getClassLoader():
ij.io.PluginClassLoader@798928

Can you give me a little more detail on the code if you think I
should be comparing this to another ClassLoader?

Bill

>Hi,
>
>On Wed, 29 Apr 2009, Bill Mohler wrote:
>
>>  Thanks, Curtis.  Here's what I get
>>
>>  MultiQTVirtualStack1
>>  stack class = MultiQTVirtualStack
>>  MultiQTVirtualStack class = MultiQTVirtualStack
>>  Classes equal? false/false
>>  path to MultiQTVirtualStack class =
>>
>>file:/Applications/ImageJ/plugins/QuickTime_Plugins_MMRD041109/MultiQTVirtualStack.class
>>  path to stack class =
>>
>>file:/Applications/ImageJ/plugins/QuickTime_Plugins_MMRD041109/MultiQTVirtualStack.class
>>  beforetheloop imp[3-Movie Overlay #1 : see Log window for details
>>  600x411x38961]
>>  stack[600x411x38961]
>>  intheloop j= 0 imp[3-Movie Overlay #1 : see Log window for details
>>  600x411x38961]
>>  stack[600x411x38961]
>>  MultiQTVirtualStack2
>>  MultiQTVirtualStack3
>>
>>
>>  So, mysteriously to me, the code you sent reports that they are NOT equal
>>  classes.  However both paths point to the same class file!
>
>Then I am pretty certain that two different class loaders are competing
>for the class.
>
>Could you print ...getClass().getClassLoader(), too?
>
>Ciao,
>Dscho