I would expect that the code is not finding a file in that "tmp" directory and is going directly to the catch block. So check wherever stderr is redirected to in your servlet container and you should find the stack trace there.
It's a bad idea to use relative paths in a JEE environment, because you don't know what the servlet container's current working directory is. And if you do know, you still can't rely on that knowledge. And if you assumed the path was going to be relative to your web application in some way, well, it isn't.
It is able to read the file. It is not going to catch. I am the seeing the following in the log file
getOutputStream() has already been called for this response . Instead of using Servlet, I am using Struts Action class.
Can you please move this discussion forum back to Servlet? Because, I changed my code, I am using Servlets now. I am able to download the zip file. When I extract the zip, but I am seeing following error:
When testing/extracting WinZip was unable to read file #-1 in the Zip file
Possible cause: file transfer error
I tested the code above. Instead of sending the zip file as the response object via ServletOutputStream, I am writing the zip file on the file system. When I extract the zip file on the harddisk, I don't see any problem.
Instead of ServletOutputStream, can I send the byte in any other outputstream in response object