Re: Problems with ImageIO
I saw this problem while loading a TGA reader. I was able to first resolve the problem by disabling JreMemoryLeakPreventionListener, but a better solution seems to be to put a static initializer in my webapp code that forces the container to re-scan for reader implementations once the webapp classloader is up. For example: static { ImageIO.scanForPlugins(); } , and was able to resolve it by calling Thad Humphries-2 wrote: > > I believe I'm seeing the same problem that Simone (msg #210515) is having > (this after running Tomcat for YEARS without a hitch). > > I use JAI and JAI-IMAGE I/O in various servlets. I'm running Java 1.5.17 > without the JAI or JAI-IMAGE I/O installed. I've put jai_codec.jar, > jai_core.jar, and jai_imageio.jar in my application's WEB-INF/lib > directory. > > My application runs without a hitch on Tomcat 6.0.14 on a Linux server > (and > has run fine for over a year). I have also run it on a Macintosh with > Tomcat 6.0.20. > > Today I installed Tomcat 6.0.26 on Linux and tried running my webapp. > Under > this version of Tomcat, Iterator returned by > ImageIO.getImageReadersByFormatName("tiff") returns false for hasNext(). > What gives? > > Are you seeing this, Simone? > > -- > "Hell hath no limits, nor is circumscrib'd In one self-place; but where we > are is hell, And where hell is, there must we ever be" --Christopher > Marlowe, 'Doctor Faustus' (v, 121-24) > > -- View this message in context: http://old.nabble.com/Problems-with-ImageIO-tp28169228p32553281.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: Problems with ImageIO
> From: Thad Humphries [mailto:thad.humphr...@gmail.com] > Subject: Re: Problems with ImageIO > > (1) This leak situation may arise when I use "stop" or > "reload" on my webapp. Correct. The JRE keeps a global imageio registry with a reference to a webapp-specific class, resulting in a slow PermGen memory leak. > (2) It can also be prevented by placing my JAI and JAI-IMAGE > I/O jars in CATALINA_HOME/lib or JAVA_HOME/jre/lib/ext vs my > WEB-INF/lib. Also correct, since the classes will now be loaded by a global classloader, rather than a webapp-specific one. > I prefer to keep the jars in my WEB-INF/lib as it's less > intrusive to the server manager. Which includes being easier for anyone installing your webapp. Unfortunately, you have to pick one poison or the other, since Sun mostly ignored their servlet-spec-required isolation of webapps when designing the numerous global registries. I suppose you might try a ServletContextListener that deregisters the JAI classes when your webapp is being shut down. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with ImageIO
Chuck, Setting the JreMemoryLeakPreventionListener attribute appContextProtection="false" also fixes the problem. My read of documentation makes me think (1) This leak situation may arise when I use "stop" or "reload" on my webapp. (2) It can also be prevented by placing my JAI and JAI-IMAGE I/O jars in CATALINA_HOME/lib or JAVA_HOME/jre/lib/ext vs my WEB-INF/lib. Is this read correct? Regarding #2, javax.imageio.ImageIO is part of the JDK, but the readers for TIFF are loaded from jai_imageio.jar I prefer to keep the jars in my WEB-INF/lib as it's less intrusive to the server manager. --Thad On Wed, Apr 7, 2010 at 4:05 PM, Caldarale, Charles R < chuck.caldar...@unisys.com> wrote: > > From: Thad Humphries [mailto:thad.humphr...@gmail.com] > > Subject: Re: Problems with ImageIO > > > > Thanks, Chuck, Mark. That fixed it. > > There are several attributes that can be toggled on and off in the > listener; you could try those one by one, rather than disabling everything. > I suspect it's this one: appContextProtection. > > Doc is near the bottom of this page: > http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you received > this in error, please contact the sender and delete the e-mail and its > attachments from all computers. > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, 'Doctor Faustus' (v, 121-24)
RE: Problems with ImageIO
> From: Thad Humphries [mailto:thad.humphr...@gmail.com] > Subject: Re: Problems with ImageIO > > Thanks, Chuck, Mark. That fixed it. There are several attributes that can be toggled on and off in the listener; you could try those one by one, rather than disabling everything. I suspect it's this one: appContextProtection. Doc is near the bottom of this page: http://tomcat.apache.org/tomcat-6.0-doc/config/listeners.html - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with ImageIO
Ah! Gotcha. Thanks, Chuck, Mark. That fixed it. (Sorry for being so dense. Since Tomcat moved from v3.2 to v4, it's been about the most trouble-free app I use. I haven't fussed with configuration in YEARS.) On Wed, Apr 7, 2010 at 3:48 PM, Caldarale, Charles R < chuck.caldar...@unisys.com> wrote: > > From: Thad Humphries [mailto:thad.humphr...@gmail.com] > > Subject: Re: Problems with ImageIO > > > > "JreLeakPreventionListener ?" > > I believe Mark was suggesting that you try disabling the > JreMemoryLeakPreventionListener in conf/server.xml, just in case it was > interfering with the JAI registration. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you received > this in error, please contact the sender and delete the e-mail and its > attachments from all computers. > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, 'Doctor Faustus' (v, 121-24)
RE: Problems with ImageIO
> From: Thad Humphries [mailto:thad.humphr...@gmail.com] > Subject: Re: Problems with ImageIO > > "JreLeakPreventionListener ?" I believe Mark was suggesting that you try disabling the JreMemoryLeakPreventionListener in conf/server.xml, just in case it was interfering with the JAI registration. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with ImageIO
On Apr 7, 2010, at 1:38 PM, Thad Humphries wrote: > Today I installed Tomcat 6.0.26 on Linux and tried running my webapp. Under > this version of Tomcat, Iterator returned by > ImageIO.getImageReadersByFormatName("tiff") returns false for hasNext(). I had a similar problem (though it's maybe not even related) setting up a new Tomcat server on a fresh Ubuntu Linux install. We also use tif images and I had to install a couple extra ImageMagick packages, as well as something in JAI to get it to recognize .tif as a format. Until I did that, I could not process tiff images. Jon Brisbin Portal Webmaster NPC International, Inc. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with ImageIO
"JreLeakPreventionListener ?" I'm sorry, I don't follow. Is there a monitor I can run? If you mean the "Find leaks" button in the Manager webpage ( http://localhost:8080/manager/html/findleaks), no, none are found. On Wed, Apr 7, 2010 at 3:24 PM, Mark Thomas wrote: > On 07/04/2010 19:38, Thad Humphries wrote: > >> I believe I'm seeing the same problem that Simone (msg #210515) is having >> (this after running Tomcat for YEARS without a hitch). >> >> I use JAI and JAI-IMAGE I/O in various servlets. I'm running Java 1.5.17 >> without the JAI or JAI-IMAGE I/O installed. I've put jai_codec.jar, >> jai_core.jar, and jai_imageio.jar in my application's WEB-INF/lib >> directory. >> >> My application runs without a hitch on Tomcat 6.0.14 on a Linux server >> (and >> has run fine for over a year). I have also run it on a Macintosh with >> Tomcat 6.0.20. >> >> Today I installed Tomcat 6.0.26 on Linux and tried running my webapp. >> Under >> this version of Tomcat, Iterator returned by >> ImageIO.getImageReadersByFormatName("tiff") returns false for hasNext(). >> What gives? >> > > JreLeakPreventionListener ? > > Mark > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, 'Doctor Faustus' (v, 121-24)
Re: Problems with ImageIO
On 07/04/2010 19:38, Thad Humphries wrote: I believe I'm seeing the same problem that Simone (msg #210515) is having (this after running Tomcat for YEARS without a hitch). I use JAI and JAI-IMAGE I/O in various servlets. I'm running Java 1.5.17 without the JAI or JAI-IMAGE I/O installed. I've put jai_codec.jar, jai_core.jar, and jai_imageio.jar in my application's WEB-INF/lib directory. My application runs without a hitch on Tomcat 6.0.14 on a Linux server (and has run fine for over a year). I have also run it on a Macintosh with Tomcat 6.0.20. Today I installed Tomcat 6.0.26 on Linux and tried running my webapp. Under this version of Tomcat, Iterator returned by ImageIO.getImageReadersByFormatName("tiff") returns false for hasNext(). What gives? JreLeakPreventionListener ? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problems with ImageIO
I believe I'm seeing the same problem that Simone (msg #210515) is having (this after running Tomcat for YEARS without a hitch). I use JAI and JAI-IMAGE I/O in various servlets. I'm running Java 1.5.17 without the JAI or JAI-IMAGE I/O installed. I've put jai_codec.jar, jai_core.jar, and jai_imageio.jar in my application's WEB-INF/lib directory. My application runs without a hitch on Tomcat 6.0.14 on a Linux server (and has run fine for over a year). I have also run it on a Macintosh with Tomcat 6.0.20. Today I installed Tomcat 6.0.26 on Linux and tried running my webapp. Under this version of Tomcat, Iterator returned by ImageIO.getImageReadersByFormatName("tiff") returns false for hasNext(). What gives? Are you seeing this, Simone? -- "Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, 'Doctor Faustus' (v, 121-24)
Re: Problems with ImageIO custom service providers with Tomcat >= 6.0.24
On Tue, Mar 30, 2010 at 9:41 AM, Mark Thomas wrote: > On 30/03/2010 08:03, Simone Giannecchini wrote: >> Ciao Mark, >> thanks for your answer. >> The short explanation is the one I gave "It looks like that ImageIO >> additional service providers are not loaded >> anymore at runtime via the standard jar META-INF/services mechanism." >> >> Longer explanation is as follows. ImageIO allows to define additional >> readers/writers by means of the javax ServiceRegistry/IIORegistry >> mechanism: this mechanism basically requires that we put complete >> classnames for the service strategies we have defined for a certain >> interface inside a text file whose name is the complete classname of >> the interface, e.g. javax.imageio.spi.ImageInputStreamSpi. Does this >> make sense? > > That makes sense but doesn't tell me anything I didn't already know. > > Still no info on when you see this issue. All the time? Just on reload? > Randomly? The webapp I am talking about is a GeoSpatial server called GeoServer. At startup my own SPI implementations are not registered anymore in the IIORegistry. > > Still no info on where these JARs are located. In a WAR, in > CATALINA_HOME/lib, somewhere else? Libs are inside WEB-INF/lib of GeoServer WAR. Thx, Simone. > > Mark > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with ImageIO custom service providers with Tomcat >= 6.0.24
On 30/03/2010 08:03, Simone Giannecchini wrote: > Ciao Mark, > thanks for your answer. > The short explanation is the one I gave "It looks like that ImageIO > additional service providers are not loaded > anymore at runtime via the standard jar META-INF/services mechanism." > > Longer explanation is as follows. ImageIO allows to define additional > readers/writers by means of the javax ServiceRegistry/IIORegistry > mechanism: this mechanism basically requires that we put complete > classnames for the service strategies we have defined for a certain > interface inside a text file whose name is the complete classname of > the interface, e.g. javax.imageio.spi.ImageInputStreamSpi. Does this > make sense? That makes sense but doesn't tell me anything I didn't already know. Still no info on when you see this issue. All the time? Just on reload? Randomly? Still no info on where these JARs are located. In a WAR, in CATALINA_HOME/lib, somewhere else? Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with ImageIO custom service providers with Tomcat >= 6.0.24
Ciao Mark, thanks for your answer. The short explanation is the one I gave "It looks like that ImageIO additional service providers are not loaded anymore at runtime via the standard jar META-INF/services mechanism." Longer explanation is as follows. ImageIO allows to define additional readers/writers by means of the javax ServiceRegistry/IIORegistry mechanism: this mechanism basically requires that we put complete classnames for the service strategies we have defined for a certain interface inside a text file whose name is the complete classname of the interface, e.g. javax.imageio.spi.ImageInputStreamSpi. Does this make sense? Simone. --- Ing. Simone Giannecchini GeoSolutions S.A.S. Founder - Software Engineer Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob:+39 333 8128928 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/simonegiannecchini http://twitter.com/simogeo --- On Tue, Mar 30, 2010 at 1:31 AM, Mark Thomas wrote: > On 30/03/2010 00:21, Simone Giannecchini wrote: >> Ciao, >> long story short, in an OS geospatial project that we maintain we are >> experiencing problems when deploying on Tomcat >= 6.0.24 due to the >> latest permgen fixes ( I guess). > > Define problems. What? When? > >> It looks like that ImageIO additional service providers are not loaded >> anymore at runtime via the standard jar META-INF/services mechanism. >> Any hints for putting together a workaround? > > How about some hints on what problem you are seeing. > > Mark > > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Problems with ImageIO custom service providers with Tomcat >= 6.0.24
On 30/03/2010 00:21, Simone Giannecchini wrote: > Ciao, > long story short, in an OS geospatial project that we maintain we are > experiencing problems when deploying on Tomcat >= 6.0.24 due to the > latest permgen fixes ( I guess). Define problems. What? When? > It looks like that ImageIO additional service providers are not loaded > anymore at runtime via the standard jar META-INF/services mechanism. > Any hints for putting together a workaround? How about some hints on what problem you are seeing. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Problems with ImageIO custom service providers with Tomcat >= 6.0.24
Ciao, long story short, in an OS geospatial project that we maintain we are experiencing problems when deploying on Tomcat >= 6.0.24 due to the latest permgen fixes ( I guess). It looks like that ImageIO additional service providers are not loaded anymore at runtime via the standard jar META-INF/services mechanism. Any hints for putting together a workaround? Ciao, Simone. --- Ing. Simone Giannecchini GeoSolutions S.A.S. Founder - Software Engineer Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob:+39 333 8128928 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/simonegiannecchini http://twitter.com/simogeo --- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org