1

Am using Parse DB for my backend , used method like Login,SaveInBackground,FindInBackGround, most of the function is working except, One function which uses SaveInBackground(){....} other method with same SaveInBackground () is working

This is the method for which the error occurred

 private void xxdatat(final ParseObject receiverObject) {
    ParseObject obj = new ParseObject(Constants.XXX);
    obj.put("SENDER_ID", objdata);          //parse object type
    obj.put("RECIEIVER_ID", Robjdata);      //parse object type
    obj.put("REQUEST_TYPE", stingdata);     //String type
    obj.saveInBackground(new SaveCallback() {
        @Override
        public void done(ParseException e) {
            if (e==null) {
                DialogUtil.showDialog(mContext, "working");
            } else {
                DialogUtil.showDialog(mContext,"Not working");

            }
        }
    });

I surfed through the internet and find some solutions to be made in parse configuration file.

Parse.initialize(new Parse.Configuration.Builder(this)
            .applicationId(APP_ID)
            .clientKey(CLIENT_KEY)
            .addNetworkInterceptor(new ParseLogInterceptor())
            .server("https://parse.xxxyyyzzz.com/parse/")
            .build());

The link is completed by "/"

As observed there are errors while converting the data from parse to JSONObject and the exception is also JSONException.

How to solve this issue? Thanks in advance.

com.parse.ParseRequest$ParseRequestException: bad json response
    at com.parse.ParseRequest.newTemporaryException(ParseRequest.java:290)
    at com.parse.ParseRESTCommand.onResponseAsync(ParseRESTCommand.java:308)
    at com.parse.ParseRequest$3.then(ParseRequest.java:137)
    at com.parse.ParseRequest$3.then(ParseRequest.java:133)
    at bolts.Task$15.run(Task.java:917)
    at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105)
    at bolts.Task.completeAfterTask(Task.java:908)
    at bolts.Task.continueWithTask(Task.java:715)
    at bolts.Task.continueWithTask(Task.java:726)
    at bolts.Task$13.then(Task.java:818)
    at bolts.Task$13.then(Task.java:806)
    at bolts.Task$15.run(Task.java:917)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:818)
    Caused by: org.json.JSONException: Value <html> of type java.lang.String cannot be converted to JSONObject
    at org.json.JSON.typeMismatch(JSON.java:111)
    at org.json.JSONObject.<init>(JSONObject.java:160)
    at org.json.JSONObject.<init>(JSONObject.java:173)
    at com.parse.ParseRESTCommand.onResponseAsync(ParseRESTCommand.java:298)
    at com.parse.ParseRequest$3.then(ParseRequest.java:137) 
    at com.parse.ParseRequest$3.then(ParseRequest.java:133) 
    at bolts.Task$15.run(Task.java:917) 
    at bolts.BoltsExecutors$ImmediateExecutor.execute(BoltsExecutors.java:105) 
    at bolts.Task.completeAfterTask(Task.java:908) 
    at bolts.Task.continueWithTask(Task.java:715) 
    at bolts.Task.continueWithTask(Task.java:726) 
    at bolts.Task$13.then(Task.java:818) 
    at bolts.Task$13.then(Task.java:806) 
    at bolts.Task$15.run(Task.java:917) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 
    at java.lang.Thread.run(Thread.java:818)
5
  • That means your JSON is not valid format. Commented Nov 9, 2016 at 12:05
  • check your json url is valid or not? jsonlint.com Commented Nov 9, 2016 at 12:05
  • Actually converting JSON will be done by the parse SDK , There is no my part of code goes in.And It works initially well. after few days i doesn't. Commented Nov 9, 2016 at 12:08
  • What version of the sdk are you using? Commented Nov 10, 2016 at 21:06
  • parse sdk version 1.13.1 Commented Nov 11, 2016 at 5:28

1 Answer 1

0

Finally solved this issues by creating a new table in db with same structure and different name.

Now there is no issues working fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.