线程中的异常"线程0" java.lang.RuntimeException:Stub

时间:2015-02-13 19:30:59

标签: java android json stream bufferedreader

有人能解释一下" Thread-0" java.lang.RuntimeException:Stub!例外是?当我尝试使用以下方法读取Json对象时,会生成此错误:

 public void getEvent() throws IOException, ClassNotFoundException, JSONException {
    //Read object, take string and convstruct new JSon object
    StringBuffer buf = new StringBuffer();
    String line;
    boolean done = false;
    while (!done) {
        line = reader.readLine();
        if (line == null || line.isEmpty()) {
            System.out.println("Done");
            done = true;
        }
        else {
            buf.append(line);
        }
    }
    if (buf.length()==0) {
        System.out.println("NOTHING IN JSON");
        return null;
    }


    JSONObject jo = new JSONObject(buf.toString()); // Here is where the error is generated 
}

这是堆栈跟踪:

 Exception in thread "Thread-0" java.lang.RuntimeException: Stub!
   at org.json.JSONObject.<init>(JSONObject.java:7)
   at edu.carleton.l8server.JSONEventSource.getEvent(JSONEventSource.java:57)
  at edu.carleton.l8server.ThreadWithReactor.run(ThreadWithReactor.java:37)

0 个答案:

没有答案