Re: Strange ClassCastException: A puzzle for Java/ImageJ experts to help me wit?.
Posted by
Bill Mohler on
Apr 29, 2009; 4:28pm
URL: http://imagej.273.s1.nabble.com/Strange-ClassCastException-A-puzzle-for-Java-ImageJ-experts-to-help-me-wit-tp3692688p3692703.html
Dscho, again I'm very new to this stuff. When I try these
suggestions (from your earlier email), I get the following errors
from Compile and Run:
/Applications/ImageJ/plugins/QuickTime_Plugins_MMRD041109/MovieAlignFrameMOD.java:275:
log(java.lang.String) in ij.IJ cannot be applied to (java.net.URL)
IJ.log( stack.getClass().getResource("MultiQTVirtualStack.class") );
^
/Applications/ImageJ/plugins/QuickTime_Plugins_MMRD041109/MovieAlignFrameMOD.java:277:
log(java.lang.String) in ij.IJ cannot be applied to (java.net.URL)
IJ.log(Class.forName("MultiQTVirtualStack").getResource("MultiQTVirtualStack.class")
);
^
/Applications/ImageJ/plugins/QuickTime_Plugins_MMRD041109/MovieAlignFrameMOD.java:279:
log(java.lang.String) in ij.IJ cannot be applied to (java.net.URL)
IJ.log( MultiQTVirtualStack.class.getResource("MultiQTVirtualStack.class") );
????
>Hi,
>
>On Wed, 29 Apr 2009, Bill Mohler wrote:
>
>> IJ.log(""+stack.getClass().getName() + "2");
>>
>> /** THIS DOES NOT REPORT, SO IT'S CLEAR THAT stack IS
>> NOT reporting as instanceof MultiQTVirtualStack,
>> even though it reports as one using
>> stack.getClass().getName() **/
>> if (stack instanceof
>> MultiQTVirtualStack ) IJ.log("MultiQTVirtualStack? Yes!!!!");
>>
>> /*** ...But THIS STILL READS OUT AS
>> MultiQTVirtualStack ******/
>>
>> IJ.log(""+stack.getClass().getName() + "3");
>
>Just a hunch, could you compare
>
>stack.getClass().getResource("MultiQTVirtualStack.class")
>
>to
>
>Class.forName("MultiQTVirtualStack").getResource("MultiQTVirtualStack.class")?
>
>(Maybe even MultiQTVirtualStack.class.getResource(...))
>
>I _could_ imagine that there is a class loader problem...
>
>Ciao,
>Dscho