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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:17:46+00:00 2026-06-04T07:17:46+00:00

I’ve been trying to query NCBI blast website using Android and BioJava . I’m

  • 0

I’ve been trying to query NCBI blast website using Android and BioJava. I’m using Eclipse with the Android emulator. When I run the code as an Android app I get the following errors:

W/System.err(533): java.io.IOException: An error occured submiting sequence to BLAST server. Cause: content-length promised 2000 bytes, but received 214

When I take the very same code and run it as a regular Java app it works perfectly. Any ideas on what it might be?

  • 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-06-04T07:17:47+00:00Added an answer on June 4, 2026 at 7:17 am

    It also occured to me while I was trying to make a POST request in Android . If you set Content-Length in headers and the actual content has a different length, it will throw an IOException in Android (in plain JDK it worked, although it is wrong)

    You can reproduce the Exception using the following code:

    try {
        URL oracle = new URL("http://oasth.gr/tools/lineTimes.php");
        HttpURLConnection yc = (HttpURLConnection) oracle.openConnection();
    
        yc.setRequestProperty("User-Agent",
                "Mozilla/5.0 (X11; Linux i686; rv:2.0b12) Gecko/20110222 Firefox/4.0b12");
        yc.setRequestProperty("Referer",
                "http://oasth.gr/tools/lineTimes.php");
        yc.setRequestProperty("Accept-Language",
                "el-gr,el;q=0.8,en-us;q=0.5,en;q=0.3");
        yc.setRequestProperty("Accept-Charset",
                "ISO-8859-7,utf-8;q=0.7,*;q=0.7");
    
        // content length should be 29 !!
        yc.setRequestProperty("Content-Length", "1000");
    
        // content length is 29 !
        String parames = "bline=63&goes=a&lineStops=886";
    
        yc.setDoOutput(true);
    
        OutputStreamWriter wr = new OutputStreamWriter(yc.getOutputStream());
    
        wr.write(parames);
        wr.flush();
        Log.d(TAG, "" + yc.getResponseCode());
    
        BufferedReader in = new BufferedReader(new InputStreamReader(
                yc.getInputStream()));
        String inputLine;
    
        StringBuilder sbu = new StringBuilder();
    
        while ((inputLine = in.readLine()) != null)
            sbu.append(inputLine);
    
        wr.close();
        in.close();
    
    } catch (IOException e) {
        e.printStackTrace();
        Log.e("getLinesArrival Exception", e.getMessage());
    }
    

    so if you remove line

    yc.setRequestProperty("Content-Length", "1000");
    

    it will work!

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I am using Paperclip to handle profile photo uploads in my app. They upload
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of 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.