You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Thad Humphries <th...@gmail.com> on 2010/04/07 20:38:01 UTC
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<ImageReader> 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
Posted by Nubile <ry...@gmail.com>.
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<ImageReader> 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Problems with ImageIO
Posted by Jon Brisbin <jo...@npcinternational.com>.
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<ImageReader> 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Problems with ImageIO
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Thad Humphries [mailto:thad.humphries@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Problems with ImageIO
Posted by Thad Humphries <th...@gmail.com>.
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.Caldarale@unisys.com> wrote:
> > From: Thad Humphries [mailto:thad.humphries@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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@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
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Thad Humphries [mailto:thad.humphries@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Problems with ImageIO
Posted by Thad Humphries <th...@gmail.com>.
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.Caldarale@unisys.com> wrote:
> > From: Thad Humphries [mailto:thad.humphries@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-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@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
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Thad Humphries [mailto:thad.humphries@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Problems with ImageIO
Posted by Thad Humphries <th...@gmail.com>.
"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 <ma...@apache.org> 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<ImageReader> returned by
>> ImageIO.getImageReadersByFormatName("tiff") returns false for hasNext().
>> What gives?
>>
>
> JreLeakPreventionListener ?
>
> Mark
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@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
Posted by Mark Thomas <ma...@apache.org>.
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<ImageReader> returned by
> ImageIO.getImageReadersByFormatName("tiff") returns false for hasNext().
> What gives?
JreLeakPreventionListener ?
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org