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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:57:03+00:00 2026-06-05T06:57:03+00:00

If the temp string is very large I get java.io.IOException: Error writing to server

  • 0

If the temp string is very large I get java.io.IOException: Error writing to server at getInputStream

String tmp  = js.deepSerialize(taskEx);
URL url = new URL("http://"
                    + "localhost"
                    + ":"
                    + "8080"
                    + "/Myproject/TestServletUpdated?command=startTask&taskeId=" +taskId + "'&jsonInput={\"result\":"
                    + URLEncoder.encode(tmp) + "}"); 

                    URLConnection conn = url.openConnection();
                     InputStream is = conn.getInputStream();

Why is that?
This call goes to the servlet mentioned in the URL.

  • 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-05T06:57:05+00:00Added an answer on June 5, 2026 at 6:57 am

    I think you might have a “too long url”, the maximum number of characters are 2000 (see this SO post for more info). GET requests are not made to handle such long data input.

    You can, if you can change the servlet code also, change it into a POST instead of a GET request (as you have today). The client code would look pretty simular:

    public static void main(String[] args) throws IOException {
    
        URL url = new URL("http", "localhost:8080", "/Myproject/TestServletUpdated");
    
        URLConnection conn = url.openConnection();
        conn.setDoOutput(true);
    
        OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream());
        wr.write("command=startTask" +
                 "&taskeId=" +taskId +
                 "&jsonInput={\"result\":" + URLEncoder.encode(tmp) + "}");
        wr.flush();
    
    
        .... handle the answer ...
    }
    

    I didn’t see it first but it seems like you have a single quote character in your request string.

    ...sk&taskeId=" + taskId + "'&jso.....
                                ^
    

    try removing it, it might help you!

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

Sidebar

Related Questions

This fails string temp = () => {return test;}; with the error Cannot convert
I've got some very basic code like while (scan.hasNextLine()) { String temp = scan.nextLine();
String[] temp = new String[adapter.getCount()]; for(int i = 0; i < adapter.getCount(); i++) temp[i]
string temp is equal to ZERO:\t.WORD\t1 from my debugger. (the first line of my
def manage_bread_crumb(self, testvar): stzr = '' if self.session.get('temp_sesison') != None: stzr = pickle.loads(str(self.session.get('temp_sesison'))) string
SOLUTION Thanks to 1111... vector<std::string> split_at_line(string str, int lines) { vector<std::string> nine_ln_strs; string temp;
I have code like this: string uriString = @C:\Temp\test.html; Uri uri = new Uri(uriString);
string popUpHTML=; var xx = from Temp in TemplateList where ( Temp.TitleID == titleID
Upon compiling and running this small program to reverse a string, I get a
I made a MegaInt class that could handle very large numbers and overloaded a

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.