I bet you are doing a GET or POST to a
servlet or
JSP page. If it's a servlet, you will probably want to make sure that you specifically close the output stream with
HttpServletResponse.getWriter().close()
If it's a JSP page, check to make sure that you aren't getting an exception which never forwards to an error page. I'm not sure, but I think if the servlet sets the HTTP status to anything higher than 2xx, (such as the 500 that a JSP page generates if there is an uncaught error), URLConnection will complain about a FileNotFoundException.