tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Konstantin Kolinko <knst.koli...@gmail.com>
Subject Re: Registering Plugins, e.g. javax.imageio...
Date Wed, 11 Sep 2013 16:44:13 GMT
2013/9/11 Christopher Schultz <chris@christopherschultz.net>:
> On 9/10/13 6:34 PM, George S. wrote:
>>
>> On 9/10/13 3:14 PM, Christopher Schultz wrote:
>>> ----- Is there a way that I can specify something in the
>>> server.xml code that would register them? The only thing I can
>>> see is to create a org.apache.catalina.LifecycleListener and put
>>> the code to register the plugins in there.
>>>
>>> Is there some other way of doing it? How would you do it if you
>>> weren't running under Tomcat?
>>
>> I only ever run Java with tomcat (or maybe ant), so I wouldn't
>> know.
>
> Okay. I had never heard of an "imageio plugin" before. Are you
> basically registering file-type handlers?
>
> I'm just guessing at all of this, since I've never done anything
> besides use ImageIO for mundane operations like loading, saving, and
> re-sizing images.
>
> Have you called ImageIO.scanForPlugins()?
>
> The documentation gives light detains on how the plug-ins are found:
>
> http://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html#scanForPlugins%28%29
>

Those docs say that scanning is performed automatically on first access.

As such, I would really recommend to write a Listener,  so that
whatever classes are  found by scanning were loaded by the System
classloader and had no references to the Webapp one.

Having unexpected references to the Webapp classloader would be bad,
as it leads to PermGen memory leaks.

The above is just a theoretical recommendation. I do not know how
ImageIO manages those classes internally.

BTW, beware of known issue, mentioned in the FAQ,
http://wiki.apache.org/tomcat/FAQ/KnownIssues#ImageIOIssues


Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message