Hi,
When I deploy my geotools app on Glassfish server I'm getting a *lot* of 
warning about streams being left open and not explicitly closed.
Some of these seem to be being produced from very simple things (eg. 
instantiating a GridSampleDimension). 

For instance here's a stack trace I'm getting :

WARNING: Input stream has been finalized or forced closed without being 
explicitly closed; stream instantiation reported in following stack trace
java.lang.Throwable
        at 
com.sun.enterprise.loader.ASURLClassLoader$SentinelInputStream.<init>(ASURLClassLoader.java:1230)
        at 
com.sun.enterprise.loader.ASURLClassLoader$InternalJarURLConnection.getInputStream(ASURLClassLoader.java:1338)
        at java.net.URL.openStream(URL.java:1010)
        at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1194)
        at 
com.sun.enterprise.loader.ASURLClassLoader.getResourceAsStream(ASURLClassLoader.java:872)
        at java.lang.Class.getResourceAsStream(Class.java:2030)
        at 
com.sun.media.jai.util.PropertyUtil.getFileFromClasspath(PropertyUtil.java:72)
        at com.sun.media.jai.util.PropertyUtil.getBundle(PropertyUtil.java:140)
        at com.sun.media.jai.util.PropertyUtil.getString(PropertyUtil.java:157)
        at javax.media.jai.operator.JaiI18N.getString(JaiI18N.java:19)
        at 
javax.media.jai.operator.AbsoluteDescriptor.<clinit>(AbsoluteDescriptor.java:65)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at 
javax.media.jai.RegistryFileParser.getInstance(RegistryFileParser.java:216)
        at 
javax.media.jai.RegistryFileParser.registerDescriptor(RegistryFileParser.java:352)
        at 
javax.media.jai.RegistryFileParser.parseFile(RegistryFileParser.java:287)
        at 
javax.media.jai.RegistryFileParser.loadOperationRegistry(RegistryFileParser.java:47)
        at 
javax.media.jai.OperationRegistry.initializeRegistry(OperationRegistry.java:363)
        at javax.media.jai.JAI.<clinit>(JAI.java:560)
        at 
org.geotools.coverage.GridSampleDimension.<clinit>(GridSampleDimension.java:1434)
        at 
org.autogena.skyserver.data.filetypes.SwathFile.readDataSet(SwathFile.java:355)


And here's the line of code calling that : 
GridSampleDimension dimension = new GridSampleDimension(dataset.getName(), new 
Category[] { category }, null);

I can't see anywhere where I could possibly be closing that stream myself, so 
I'm not sure what to do. It looks like I'm leaking a stream every single time I 
call new GridSampleDimension, which doesn't seem sustainable - though I haven't 
run my app long enough yet to actually have it run out of resources.

There are also a lot of other places where I'm having the same issue - for 
instance I filed this bug ( http://jira.codehaus.org/browse/GEOT-2959 ) along 
with a patch in 2010, but the issue is still marked as open. Am I missing 
something here, or is geotools just designed to leak a lot of streams (maybe 
it's not as bad as it sounds and these threads get cleaned up by the system 
eventually anyway....) ?


cheers,
Josh
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to