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 3221868
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T15:55:33+00:00 2026-05-17T15:55:33+00:00

I’m building Java client that will automatically upload file from Java server to Panda

  • 0

I’m building Java client that will automatically upload file from Java server to Panda Instance that I installed on my EC2 cloud using their AMI. I’m trying to use Apache HTTP Components to upload to Panda Server (Panda Stream). It works fine with my browser client but for some reason I can’t upload from that library. Here is my code:

String videoUploadUrl = "http://[panda server ip]/videos/" + getVideoID() + "/upload.xml";
File file = new File("/temp/videofile.mp4");

DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);

HttpPost httppost = new HttpPost(videoUploadUrl);

MultipartEntity mpEntity = new MultipartEntity();

ContentBody fBody = new FileBody(file);

mpEntity.addPart("userfile", fBody);

httppost.setEntity(mpEntity);


System.out.println("executing request " + httppost.getRequestLine());
HttpResponse response2 = httpclient.execute(httppost); // <-- FAILS HERE
System.out.println("finish executing request");

HttpEntity resEntity = response2.getEntity();

System.out.println(response2.getStatusLine());
if (resEntity != null) {
    System.out.println(EntityUtils.toString(resEntity));
}
if (resEntity != null) {
    resEntity.consumeContent();
}

httpclient.getConnectionManager().shutdown();

And here is my error log.

executing request POST http://[panda server ip]/videos/0fbd7300-b7b2-012d-7c3f9-1223456a654/upload.xml HTTP/1.1 Method: POST
Oct 11, 2010 3:09:25 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Broken pipe
Oct 11, 2010 3:09:25 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Oct 11, 2010 3:09:55 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: I/O exception (java.net.SocketException) caught when processing request: Broken pipe
Oct 11, 2010 3:09:55 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Exception in thread "main" java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
        at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
        at org.apache.http.impl.io.AbstractSessionOutputBuffer.write(AbstractSessionOutputBuffer.java:124)
        at org.apache.http.impl.io.ContentLengthOutputStream.write(ContentLengthOutputStream.java:114)
        at org.apache.http.entity.mime.content.FileBody.writeTo(FileBody.java:105)
        at org.apache.http.entity.mime.HttpMultipart.doWriteTo(HttpMultipart.java:173)
        at org.apache.http.entity.mime.HttpMultipart.writeTo(HttpMultipart.java:191)
        at org.apache.http.entity.mime.MultipartEntity.writeTo(MultipartEntity.java:169)
        at org.apache.http.impl.entity.EntitySerializer.serialize(EntitySerializer.java:120)
        at org.apache.http.impl.AbstractHttpClientConnection.sendRequestEntity(AbstractHttpClientConnection.java:253)
        at org.apache.http.impl.conn.AbstractClientConnAdapter.sendRequestEntity(AbstractClientConnAdapter.java:227)
        at org.apache.http.protocol.HttpRequestExecutor.doSendRequest(HttpRequestExecutor.java:248)
        at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
        at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:623)
        at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:455)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:694)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:625)
        at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:603)
        at testmainjava.FileUpload.main(FileUpload.java:57)

What am I missing? Why I’m getting broken pipe. If I use same code to upload to some servlet then I work fine but not with panda Instance.
Any idea?

  • 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-17T15:55:33+00:00Added an answer on May 17, 2026 at 3:55 pm

    In order to ease your troubleshooting and find out what is happening:

    • turn on HttpClient wire level logging
    • use LiveHttpHeaders or similar plugin to find out how the browser is handling this
    • use WireShark or similar tool for checking the network level traffic

    Then, compare the differences between browser and HttpClient.

    One thing I noticed: in your code, you are posting the video as “userfile” parameter, but PandaStream API documentation says that you should use “file” parameter. Not sure if it makes a difference, though.

    Even if the parameter name is wrong, PandaStream should still return a proper response, not just close the connection in case of error.

    Finally, did you configure PandaStream to send you the error messages? If not, this could help, if it is encountering some errors (see the getting started guide for that).

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a French site that I want to parse, but am running into
We're building an app, our first using Rails 3, and we're having to build
I have a bunch of posts stored in text files formatted in yaml/textile (from
Seemingly simple, but I cannot find anything relevant on the web. What is the

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.