Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6366935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:29:07+00:00 2026-05-25T00:29:07+00:00

I am facing this issue with the servlet when i am trying to stream

  • 0

I am facing this issue with the servlet when i am trying to stream video file from the server.
The code to server the file

    if (contentType == null) {
        contentType = "application/octet-stream";
    }

    response.reset();
    response.setBufferSize(ServerConfiguration.DEFAULT_BUFFER_SIZE);
    response.setContentType(contentType);
    response.setHeader("Content-Length", String.valueOf(file.length()));
    response.setHeader("Content-Disposition", "inline; filename=\"" + file.getName() + "\"");
    response.setHeader("Cache-Control", "public") ;


     BufferedInputStream input = null;
     BufferedOutputStream output = null;

        try {
            // Open streams.
            input = new BufferedInputStream(new FileInputStream(file), ServerConfiguration.DEFAULT_BUFFER_SIZE);
            output = new BufferedOutputStream(response.getOutputStream(), ServerConfiguration.DEFAULT_BUFFER_SIZE);

            // Write file contents to response.
            byte[] buffer = new byte[ServerConfiguration.DEFAULT_BUFFER_SIZE];
            int length;
            while ((length = input.read(buffer)) > 0) {
                output.write(buffer, 0, length);
            }
        }
        catch (Exception e) {
            log(e);
        }
            finally {
            // Gently close streams.
            close(output);
            close(input);
        }

I have set the content-disposition to ‘inline’ and when i debug i can see the request coming to the server in an infinite loop and each time it throws this error:

ClientAbortException:  java.io.IOException
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:369)
at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:327)
at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:392)
at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:381)
at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:93)
at java.io.BufferedOutputStream.write(Unknown Source)
at com.venividi.ResourceManager.UploadFileManager.getMediaFiles(UploadFileManager.java:118)
at com.venividi.Servlet.VenividiServlet.doGet(VenividiServlet.java:182)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at com.venividi.Servlet.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:29)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:563)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:399)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:306)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:322)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1732)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Caused by: java.io.IOException
at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:208)
at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:238)
at org.apache.coyote.http11.filters.IdentityOutputFilter.doWrite(IdentityOutputFilter.java:84)
at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:190)
at org.apache.coyote.Response.doWrite(Response.java:533)
at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:364)
... 28 more

If i change the content disposition type to attachment – i am able to download the file and play the file from localsytem (which means the data is correct) but am not able to play this video file(thru the url)using VLC player (network stream option) or my custom iphone media player.

I want to do something like the server – http://www.yo-yo.org/mp4/yu.mp4 .. i can play this file by giving the URL to VLC or my Iphone app .. website for the file (http://www.yo-yo.org/mp4/) ..

The response header of the yo-yo mp4 file is

Accept-Ranges:bytes
Connection:Keep-Alive
Content-Length:7846115
Content-Type:text/plain; charset=UTF-8
Date:Mon, 15 Aug 2011 18:01:12 GMT
ETag:”32a000f-77b8e3-3bd314df3c340″
Keep-Alive:timeout=2
Last-Modified:Fri, 09 May 2003 01:39:49 GMT
Server:Apache/2.2.8 (Fedora)

while the response header of my server is

Cache-Control:public
Content-Disposition:inline; filename=”3648ef48-71bf-4393-9c0e-89fda68a683c.mp4″
Content-Length:7846115
Content-Type:video/mp4
Date:Mon, 15 Aug 2011 18:10:07 GMT
Server:Apache-Coyote/1.1

Please provide some suggestions . I will really appreciate any help

Regards
surya

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:29:08+00:00Added an answer on May 25, 2026 at 12:29 am

    I got the solution to the above issue. The chrome sends byte-range requests and the server should handle such requests, rather than writing the complete file in a single request.

    This link is helpful: Servlet Supporting Resume

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

More precisely, I am facing this issue while trying to install https://github.com/barraponto/thacker-profile (commit 75c693581796eddae5fc39870dfcc2647e00c81b
I am facing a issue wherein I am trying to play a streaming video
I'm facing a problem with IE6. I took the toggle function from this website
I am facing this issue: I have lots of threads (1024) who access one
My development team of four people has been facing this issue for some time
hello i am facing this stupid issue with no help any where. i am
I am facing this problem and finding solution for this issue since last 2
I am using the sample code to dynamically invoke a web service from this
I'm facing this issue when I'm calling AdMob ad with [rootController.view addSubview:adMobAd]; //setup the
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.