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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:56:16+00:00 2026-06-17T23:56:16+00:00

the code which i used its working perfectly on localhost but i tried to

  • 0

the code which i used its working perfectly on localhost but i tried to excute that on my web server not getting whats wrong in parsing its showing wrror while parsing from string to JSON object

My JSON Parser Code is

try {
    BufferedReader reader = new BufferedReader(new InputStreamReader(
        is, "utf-8"), 8);
    StringBuilder sb = new StringBuilder();
    String line = null;
    while ((line = reader.readLine()) != null) {
        sb.append(line + "\n");
    }
    is.close();
    json = sb.toString();
    Log.d("converted result", json);
} catch (Exception e) {
    Log.e("Buffer Error", "Error converting result " + e.toString());
}

// try parse the string to a JSON object
try {
    jObj = new JSONObject("{" + json +"}");
} catch (JSONException e) {
    Log.e("JSON Parser", "Error parsing data " + e.toString());
}

// return JSON String
return jObj;

LogCat Information

01-29 11:45:53.556: D/Search keyword:(921): saint louis
01-29 11:45:57.288: D/converted result(921): 
connected{"products":[{"pid":"406355","name":"852610 SOUTHCOUNTYMALL"},{"pid":"406356","name":"852611 SOUTHCOUNTYMALL"},{"pid":"406357","name":"852612 SOUTHCOUNTYMALL"}],"success":1}

01-29 11:45:57.288: E/JSON Parser(921): Error parsing data org.json.JSONException: Expected ':' after connected at character 11 of {connected{"products":[{"pid":"406355","name":"852610 SOUTHCOUNTYMALL"},{"pid":"406356","name":"852611 SOUTHCOUNTYMALL"},{"pid":"406357","name":"852612 SOUTHCOUNTYMALL"}],"success":1}
01-29 11:45:57.288: E/JSON Parser(921): }
  • 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-17T23:56:17+00:00Added an answer on June 17, 2026 at 11:56 pm

    As the error clearly states, your JSON is not valid, because of the word connected in front of it.

    You need to make your server stop sending that word.

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

Sidebar

Related Questions

I have written this code. Its not working but with this you should get
I am refactoring some old code that used its own type handling system which
I used the below code to upload multiple files. Its working absolutely fine but
I have a bunch of generic code that is used a lot, which i'd
I have used seekToTime in my application and its working properly. But I want
I have the following code which is used to upload large files (~6MB) to
I have this Java code which is used for JSF pagination: public List<ActiveSessionObj> list(int
I read this code in a library which is used to display a bitmap
I have a code in which Cstring and wchar_t both are used. I think
I am reading a book in which author used a code like this public

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.