Resource leak in app-schema vocab handling
------------------------------------------

                 Key: GEOT-3271
                 URL: http://jira.codehaus.org/browse/GEOT-3271
             Project: GeoTools
          Issue Type: Bug
          Components: data app-schema
    Affects Versions: 2.7-M4
            Reporter: Ben Caradoc-Davies
            Assignee: Ben Caradoc-Davies


org.geotools.filter.expression.VocabFunction does not dispose of its 
FileInputStream. This leak also prevents the file from being deleted under 
Windows.

{code}
-------- Original Message --------
Subject: RE: Re: [Geoserver-users] Deleting a *.properties file when GeoServer 
has an open handle
Date: Mon, 20 Sep 2010 12:58:05 +0800
From: Angreani, Rini (CESRE, Kensington) 
To: Caradoc-Davies, Ben (CESRE, Kensington) 

Hi Ben,

The file content should look like this:

1GRAV=urn:cgi:classifier:CGI:SimpleLithology:2008:gravel
1TILL=urn:cgi:classifier:CGI:SimpleLithology:2008:diamictite
6ALLU=urn:cgi:classifier:CGI:SimpleLithology:2008:sediment

http://docs.geoserver.org/trunk/en/user/data/app-schema/vocab-functions.html
 
I think it just locates the file, and streams it. 
Actually after looking at VocabFunction, maybe we should close the stream after 
using it?

        if( file.exists() ){
            try {
                properties.load( new FileInputStream( file ) );
            } catch (FileNotFoundException e) {
                throw new RuntimeException("Could not find file for lookup 
table "+urn );
            } catch (IOException e) {
                throw new RuntimeException("Difficulty parsing lookup table 
"+urn );
            }
        }

Sounds like we need to support vocab functions for databases (like simple 
features)? 
Gilly also asked about this last time. Perhaps for Auscope 3 :p 

Cheers
Rini
{code}

Original bug report:

{code}
-------- Original Message --------
Subject: [Geoserver-users] Deleting a *.properties file when GeoServer has an 
open handle
Date: Mon, 20 Sep 2010 10:46:16 +0800
From: smas036
To: [email protected]


Hi all, 

I'm trying to delete a .properties file that I use temporarily with the
app-schema extension but I'm unable to as GeoServer still has an open handle
on the file after a WFS request. The file is used as a vocab reference in
the mapping file. I'm using Windows Server 2008. Any ideas on how to get
GeoServer to release the file without shutting it down?

Cheers

Sina
{code}





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to