You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/02/07 10:42:46 UTC

DO NOT REPLY [Bug 6301] New: - Streams returned by getResourceAsStream don't close properly

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>