java - com.parse.ParseRequest$ParseRequestException : bad json response With Parse error code 100

标签 java parse-platform

我在后端使用 Parse DB,使用了 Login、SaveInBackground、FindInBackGround 等方法,大多数功能都在工作,除了一个使用 SaveInBackground(){....} 的其他方法与相同的 SaveInBackground () 正在工作

这是发生错误的方法

 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");

            }
        }
    });

我上网查了一下,找到了一些可以在解析配置文件中做的解决方案。

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

链接由“/”完成

据观察,将数据从解析转换为 JSONObject 时出现错误,异常也是 JSONException。

如何解决这个问题?提前致谢。

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)

最佳答案

最终通过在数据库中创建具有相同结构和不同名称的新表解决了这个问题。

现在工作正常,没有任何问题。

关于java - com.parse.ParseRequest$ParseRequestException : bad json response With Parse error code 100,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40506452/

相关文章:

Java Jackson 2.8.3 序列化包含具有循环依赖关系的抽象对象的列表

java - Spring Gradle 库中的 Controller/RestController

swift - 使用其他关注用户的用户名填充表

javascript - 云代码功能在 Parse 中运行良好,但在 back4app 中运行不佳

java - Activity 终止后 setSingleChoiceItems 值不会保留

java - 如何从 pom.xml 中的setting.xml 文件引用密码

Java 绘图到 JPanel(调试)

php - 为 Php 解析 API

ios - 注销之前不会保存当前用户的设置

android - 为 DynamoDB Android SDK 实现 CreatedAt 和 UpdatedAt 时间戳