2 Replies Latest reply on Jul 20, 2004 11:53 PM by temporary

    Help!! Internal error flushing the buffer in release()

    blackjenny Newbie

      Hi everybody!

      I am trying to play a wav file in a browser(not save to file) in jsp. The file can be downloaded but the windows media play can not play it since it's "currupt". I try to save it to the disk. It can be saved and the file size seems to be OK but still the windows media can not play it. (The original file is OK.)

      The jboss console shows the error bellow:
      WARN [PageContextImpl] Internal error flushing the buffer in release()

      Here is the jsp file:

      <%@ page import="java.util.*" %>
      <%@ page import="beans.*" %>
      <%@ page import="java.io.*"%>

      <jsp:useBean id="download" class="beans.DownloadRecording" scope="request" />


      <%
      try
      {
      String logNumber=request.getParameter("logNumber");
      String fileName=download.getRecordingFileName(logNumber);
      File file=new File(fileName);
      response.setContentType("AUDIO/X-WAV");
      response.setContentLength((int)file.length());
      String header="inline;filename=\""+fileName+"\"";
      response.setHeader("Content-Disposition",header);
      FileInputStream in=new FileInputStream(file);
      int i;
      while((i=in.read())!=-1)
      {
      out.write(i);
      }
      in.close();
      out.flush();
      out.close();
      }catch(Exception e)
      {
      //e.printStackTrace();
      String message=(e.getMessage());
      String returnPage="searchlocal.jsp";
      response.sendRedirect("errorPage.jsp?message="+message+"&page="+returnPage);

      }


      %>


      Thanks a million.

      Jenny