title: p:media not running mp3 served by servlet
body: <p>I have an MP3 audio file outside of the application context, in <code>C:/platform/musig.mp3</code>. </p>
  
  <p>I'm using the below servlet to serve it. </p>
  
  <pre><code>public class AudioServlet extends HttpServlet {
  
      @Override
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          ServletOutputStream stream = null;
          BufferedInputStream buf = null;
  
          try {
              stream = response.getOutputStream();
              File mp3 = new File("C:/platform/music.mp3");
  
              response.setContentType("audio/mpeg");
              response.addHeader("Content-Disposition", "attachment; filename=" + fileName);
              response.setContentLength((int) mp3.length());
  
              FileInputStream input = new FileInputStream(mp3);
              buf = new BufferedInputStream(input);
              int readBytes = 0;
  
              while ((readBytes = buf.read()) != -1) {
                  stream.write(readBytes);
              }
          } finally {
              if (stream != null) {
                  stream.close();
              }
              if (buf != null) {
                  buf.close();
              }
          }
      }
  
  }
  </code></pre>
  
  
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;audioServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;servlet.AudioServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;audioServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/audio/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>I'm referencing it in <code>&lt;p:media&gt;</code> as below:</p>
  
  <pre><code>&lt;p:media id="media"
      value="/audio"
      player="quicktime" 
      width="200" 
      height="40"&gt;
      &lt;f:param name="autoPlay" value="false" /&gt;
  &lt;/p:media&gt;
  </code></pre>
  
  <p>The problem is that I am unable to run the sound. If I put the audio file within the application context (in <code>/resources</code> for example), it works. But out of context, it does not work at all.</p>
  
  <p>The below exception appears in the console when the servlet is invoked:</p>
  
  <blockquote>
    <p>ClientAbortException: java.net.SocketException: Software Caused connection abort: socket write error</p>
  </blockquote>
  
  <p>Does anyone have any idea what might be happening? Or is there another way to perform MP3 with the "media" component PrimeFaces I do not know?</p>