Monday, October 28, 2013

Re: Error using IMAGE/IO in a Servlet

The problem sounds like the JreMemoryLeakPreventionListener. In $CATALINA_HOME/conf/server.xml add appContextProtection="false" to that Listener:

<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"
    appContextProtection="false" />

You will be opening up Tomcat to a memory leak, which will require restarting Tomcat when you change your WAR file.

For more on this issue, see this Tomcat thread: and the Tomcat list for more info. 

On Monday, October 28, 2013 3:32:42 PM UTC-4, Sean wrote:
I'm trying to read a .tiff on the back end of my server. I do:

FileImageInputStream fis = new FileImageInputStream(new File(p_tifName));
Object o = ImageIO.getImageReadersByFormatName(
TIFFImageReader reader = (TIFFImageReader)o;

If I run this code in the Servlet via a main() it works fine. But when running in Dev Mode, I get the error:
java.lang.ClassCastException: cannot be cast to

I have the imageIO.jar on the class path. Everything seems happy, except in Dev mode. Does anyone have any ideas? I'm at a loss at how to get around an error saying a class can't be casted to itself. 


You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment