Login  Register

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

Posted by dscho on Apr 29, 2009; 5:11pm
URL: http://imagej.273.s1.nabble.com/Strange-ClassCastException-A-puzzle-for-Java-ImageJ-experts-to-help-me-wit-tp3692688p3692704.html

Hi,

On Wed, 29 Apr 2009, Bill Mohler wrote:

> 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") );

The usual way to handle this is to call the .toString() method on the
returned object (which is of type java.net.URL IIRC).

Ciao,
Dscho