thiagolocatelli / parse4j

Java Library to deal with Parse (parse.com) REST API
http://thiagolocatelli.github.io/parse4j
143 stars 117 forks source link

Error: java.lang.NoSuchMethodError: org.json.JSONObject.keySet() #39

Open edsonlb opened 9 years ago

edsonlb commented 9 years ago

Error on "ParseQuery.getQuery" = "java.lang.NoSuchMethodError: org.json.JSONObject.keySet()"

run: 10:40:05.271 [main] DEBUG org.parse4j.util.ParseRegistry - Registering sub class _User 10:40:05.298 [main] DEBUG org.parse4j.util.ParseRegistry - Registering sub class roles 10:40:05.301 [main] DEBUG o.p.operation.ParseFieldOperations - Registering Delete decoder 10:40:05.302 [main] DEBUG o.p.operation.ParseFieldOperations - Registering Increment decoder 10:40:05.303 [main] DEBUG o.p.operation.ParseFieldOperations - Registering Add decoder 10:40:05.304 [main] DEBUG o.p.operation.ParseFieldOperations - Registering AddUnique decoder 10:40:05.307 [main] DEBUG o.p.operation.ParseFieldOperations - Registering Remove decoder 10:40:05.310 [main] DEBUG o.p.operation.ParseFieldOperations - Registering AddRelation decoder 10:40:05.311 [main] DEBUG o.p.operation.ParseFieldOperations - Registering RemoveRelation decoder FIM 10:40:05.352 [pool-1-thread-1] DEBUG org.parse4j.command.ParseCommand - Data to be sent: {"data":{"where":{"objectId":"9nmZulMSw9"}}} 10:40:05.931 [pool-1-thread-1] DEBUG org.parse4j.command.ParseGetCommand - Request URL: https://api.parse.com/1/classes/cielo Exception in thread "pool-1-thread-1" java.lang.NoSuchMethodError: org.json.JSONObject.keySet()Ljava/util/Set; at org.parse4j.command.ParseGetCommand.getRequest(ParseGetCommand.java:54) at org.parse4j.command.ParseCommand.perform(ParseCommand.java:44) at org.parse4j.ParseQuery.find(ParseQuery.java:500) at org.parse4j.ParseQuery.find(ParseQuery.java:470) at org.parse4j.ParseQuery.get(ParseQuery.java:378) at org.parse4j.ParseQuery$GetInBackgroundThread.run(ParseQuery.java:453) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

at java.lang.Thread.run(Thread.java:745)

MyCode (JAR on Project: http://prntscr.com/6o4y67): import org.parse4j.*; import org.parse4j.callback.GetCallback;

public class Consulta { public static void main(String[] args) { Parse.initialize("XYZ", "XYZ");

    ParseQuery<ParseObject> query = ParseQuery.getQuery("cielo");
    query.getInBackground("9nmZulMSw9", new GetCallback<ParseObject>() {
    @Override
    public void done(ParseObject object, ParseException e) {
        if (e == null) {
            System.out.println(object.getString("nome"));
        } else {
            System.out.println("ERRO!!!!!!!!!!!!!" + e.getMessage());
        }
    }
    }); 
    System.out.println("FIM");
}

}

edsonlb commented 9 years ago

Update Json JAR to "json-20141113.jar" and its all OK.

MahadevappaUtagi commented 5 years ago

Update Json JAR to "json-20141113.jar" and its all OK.

Still i m facing the same issue when submit job into yarn cluster.