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 24961] New: - Temporary files marked "deleteOnExit" not deleted when Tomcat runs as NT Service
Date Tue, 25 Nov 2003 03:55:13 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=24961>.
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=24961

Temporary files marked "deleteOnExit" not deleted when Tomcat runs as NT Service

           Summary: Temporary files marked "deleteOnExit" not deleted when
                    Tomcat runs as NT Service
           Product: Tomcat 4
           Version: 4.1.29
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Unknown
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: cstaylor@nanshu.com


I've written a simple JSP to illustrate:

<%@ page contentType="text/html;charset=UTF-8" session="false" 
import="java.io.*"%>
<% 
	ServletContext servlet_ctxt = getServletContext();
	File temp_directory = (File)servlet_ctxt.getAttribute
( "javax.servlet.context.tempdir" );
	File new_temp_file = File.createTempFile ( "test", "file", 
temp_directory );
	new_temp_file.deleteOnExit();
%>

Just make this available to Tomcat, run Tomcat as a console app, and when you 
CTRL-C to quit Tomcat, those files will disappear.

However, do the exact same thing using Tomcat as a service, and when you "net 
stop Apache Tomcat 4.1", those files will still exist.

I've found a workaround for my particular use of temp files, but I think that 
it would be best if this was fixed.  I believe the issue relates to how 
tomcat.exe is killing the Java process, but I'm not entirely sure.

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


Mime
View raw message