You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Scott Marshall <sm...@navis.com> on 2003/04/11 22:50:01 UTC

tar.gz.tar file throwing IOException

Ok, this is a weird one, so I hope I am not the only experiencing it.

Problem: when trying to download a file ending in .tar.gz.tar, the servlet 
throws a "Socket Closed" IOException and creates a zero bite file on the 
client.  Tried it with many different files on Netscape 7 and IE 6 on 
MacOSX and Window2000 with the same results:

jldapunx_all.tar.gz.tar  (IOException, 0 byte file)
jldapunx_all.tar.gz	(works fine)
jldapunx_all.tgz 	(works fine)

Configuration:
Redhat 6.2
Tomcat 4.1.18
Apache 2.0.44 ( taking requests for tomcat via mod_jk2/2.0.3-dev )

If try it on the Tomcat http port, no problem.  Once I bring mod_jk2 and 
apache into the picture, tomcat throws the "Socket Closed" IOException and 
the apache error log reads the following:

[Fri Apr 11 12:02:52 2003] [error] Error ajp_process_callback - write failed
[Fri Apr 11 12:02:52 2003] [error] ajp13.service() ajpGetReply recoverable 
error 3
[Fri Apr 11 12:02:52 2003] [error] Error ajp_process_callback - write failed
[Fri Apr 11 12:02:52 2003] [error] ajp13.service() ajpGetReply recoverable 
error 3
[Fri Apr 11 12:02:52 2003] [error] ajp13.service() Error  forwarding 
ajp13:localhost:8831 1 0
[Fri Apr 11 12:02:52 2003] [error] mod_jk.handler() Error connecting to 
tomcat 3

Any ideas??

Here's my code:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class DownloadFile extends HttpServlet {

     public void doGet(HttpServletRequest req, HttpServletResponse res)
				throws ServletException {
	try {
		FileInputStream fileStream = new 
FileInputStream("/web/file/jldapunx_all.tar.gz.tar");
		res.setContentType("application/zip");
		byte [] bytes = new byte[ 1024 ];

		int i;
		DataOutputStream out = new DataOutputStream(res.getOutputStream() );

		while( ( i = fileStream.read( bytes ) ) != -1 )		{
			out.write( bytes );
		}

		out.flush();					

	} catch (IOException e) {
		getServletContext().log("IOException",e);
	}
     }
}

__________________________________________
Scott Marshall - Web Site Administrator
510-267-5000 wk
mailto:scott_marshall@navis.com
	Navis LLC
	www.navis.com


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