[Geoserver-devel] IIORegistry issues on tomcat

Hi all,

Recently i ran into the dreaded well known issue with imageio plugins under tomcat, explained in detail on the geosolutions blog. [1]

The jar moving solution did not seem to work for me, but disabling the JreMemoryLeakPreventionListener (or more setting the appContextProtection to false) does work. However, while looking around for others having the same issue I also came across the last post on this thread:

http://tomcat.10.n6.nabble.com/Problems-with-ImageIO-td2073212.html

That mentions doing an ImageIO.scanForPlugins() on app startup also fixes the problem. So i tried it out in GeoServerInitStartupListener and indeed it did work for me. So question is, should we add it permanently? Any foreseen downfall? I didn’t exactly test it strenuously.

Thanks.

-Justin

[1] http://geo-solutions.blogspot.com/2010/05/fix-geotools-and-geoserver-not-able-to.html


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

On Wed, Feb 29, 2012 at 12:18 AM, Justin Deoliveira
<jdeolive@anonymised.com> wrote:

Hi all,

Recently i ran into the dreaded well known issue with imageio plugins under
tomcat, explained in detail on the geosolutions blog. [1]

The jar moving solution did not seem to work for me, but disabling the
JreMemoryLeakPreventionListener (or more setting the appContextProtection to
false) does work. However, while looking around for others having the same
issue I also came across the last post on this thread:

http://tomcat.10.n6.nabble.com/Problems-with-ImageIO-td2073212.html

That mentions doing an ImageIO.scanForPlugins() on app startup also fixes
the problem. So i tried it out in GeoServerInitStartupListener and indeed it
did work for me. So question is, should we add it permanently?
Any foreseen downfall? I didn't exactly test it strenuously.

Hmm... that sounds like a good idea, personally I'm not aware of downsides.

I'm not sure if that is the full story though, we should do something
like that for JAI as well... hmmm... probably not, as we setup our own
replacement JAI registry after the server is initialized anyways

Cheers
Andrea

--
-------------------------------------------------------
Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf

-------------------------------------------------------

Cool, thanks. So if there are no objections to doing so within a day or so i will add this in. Attached is the patch.

On Wed, Feb 29, 2012 at 4:05 AM, Andrea Aime <andrea.aime@anonymised.com> wrote:

On Wed, Feb 29, 2012 at 12:18 AM, Justin Deoliveira
<jdeolive@anonymised.com> wrote:

Hi all,

Recently i ran into the dreaded well known issue with imageio plugins under
tomcat, explained in detail on the geosolutions blog. [1]

The jar moving solution did not seem to work for me, but disabling the
JreMemoryLeakPreventionListener (or more setting the appContextProtection to
false) does work. However, while looking around for others having the same
issue I also came across the last post on this thread:

http://tomcat.10.n6.nabble.com/Problems-with-ImageIO-td2073212.html

That mentions doing an ImageIO.scanForPlugins() on app startup also fixes
the problem. So i tried it out in GeoServerInitStartupListener and indeed it
did work for me. So question is, should we add it permanently?
Any foreseen downfall? I didn’t exactly test it strenuously.

Hmm… that sounds like a good idea, personally I’m not aware of downsides.

I’m not sure if that is the full story though, we should do something
like that for JAI as well… hmmm… probably not, as we setup our own
replacement JAI registry after the server is initialized anyways

Cheers
Andrea

Ing. Andrea Aime
GeoSolutions S.A.S.
Tech lead

Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy

phone: +39 0584 962313
fax: +39 0584 962313
mob: +39 339 8844549

http://www.geo-solutions.it
http://geo-solutions.blogspot.com/
http://www.youtube.com/user/GeoSolutionsIT
http://www.linkedin.com/in/andreaaime
http://twitter.com/geowolf



Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

(attachments)

GeoserverInitStartupListener.java.patch (1.42 KB)