有人能解释一下" 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)