tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6301] New: - Streams returned by getResourceAsStream don't close properly
Date Thu, 07 Feb 2002 09:42:46 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6301>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6301

Streams returned by getResourceAsStream don't close properly

           Summary: Streams returned by getResourceAsStream don't close
                    properly
           Product: Tomcat 4
           Version: 4.0.1 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: james.kemp@northgate-is.com


In our servlet we tried to get a resource as a stream so that we can read it 
using a java Properties object, this works successfully and we close the stream 
returned to us. 
If we then use getRealPath to get to the resource we have opened using 
getResourceAsStream, create a file output stream to it, write a new property to 
the properties file then close we can get a corrupt properties file with the 
old contents.
It's as if the underlying inputstream has not been closed when we originally 
accessed the resource.
We have tested this in Resin and our test behaved as we expected.

--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message