bug_ _org.json.JSONException: End of input at character 0 of

10-16 18:28:39.549: W/System.err(4950): org.json.JSONException: End of input at character 0 of 
10-16 18:28:39.559: W/System.err(4950): at org.json.JSONTokener.syntaxError(JSONTokener.java:450)
10-16 18:28:39.569: W/System.err(4950): at org.json.JSONTokener.nextValue(JSONTokener.java:97)
10-16 18:28:39.579: W/System.err(4950): at org.json.JSONObject.<init>(JSONObject.java:154)
10-16 18:28:39.579: W/System.err(4950): at org.json.JSONObject.<init>(JSONObject.java:171)
10-16 18:28:39.589: W/System.err(4950): at net.weibanji.sociax.zzsy.YaoqingInfoActivity$4.run(YaoqingInfoActivity.java:103)
10-16 18:28:39.599: W/System.err(4950): at android.os.Handler.handleCallback(Handler.java:730)
10-16 18:28:39.609: W/System.err(4950): at android.os.Handler.dispatchMessage(Handler.java:92)
10-16 18:28:39.609: W/System.err(4950): at android.os.Looper.loop(Looper.java:137)
10-16 18:28:39.609: W/System.err(4950): at android.app.ActivityThread.main(ActivityThread.java:5103)
10-16 18:28:39.609: W/System.err(4950): at java.lang.reflect.Method.invokeNative(Native Method)
10-16 18:28:39.619: W/System.err(4950): at java.lang.reflect.Method.invoke(Method.java:525)
10-16 18:28:39.619: W/System.err(4950): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
10-16 18:28:39.619: W/System.err(4950): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)

10-16 18:28:39.619: W/System.err(4950): at dalvik.system.NativeStart.main(Native Method)

====

这个问题我也遇到了。是重新开了一个线程。

不要在主线程内访问网络,自己开一个线程去访问。

时间: 2024-08-25 03:59:27

bug_ _org.json.JSONException: End of input at character 0 of的相关文章

异常:org.json.JSONException: End of input at character 0 of

在使用Gson时遇到org.json.JSONException: End of input at character 0 of 异常. public static void jsonArrayRequest(final MainActivity mainActivity, RequestQueue rq, String uri, TextView tv1, List<News> datas) { final Gson g = new Gson(); String json = g.toJso

android中Http访问时 connection.getResponseCode()不被执行,且报错 org.json.JSONException: End of input at character 0 of .

问题:用 android 4.4 写android访问http时,到connection.getResponseCode() 就不被执行,也不报错:但是抛出org.json.JSONException: End of input at character 0 of .异常: 连接代码: public static String getJsonContent(String url_path){ try { System.out.println("url_path---->>:"

net.sf.json.JSONException: There is a cycle in the

使用hibernate容易出现该问题,主要是由于pojo类属性存在级联关系.比如说员工和部门,在员工表里面有部门属性,而在部门表里面有个员工集合,这样就存在了嵌套引用的问题了,就会抛出这个异常. 解决方法很简单,在将每个对象转为json对象的时候用setExcludes函数将级联的属性去除掉就可以了,如下面: //得到所有部门     //返回json对象字符串     public String getAllDep(){         List list = deptDAO.findAll(

报org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException:的错误

HTTP Status 500 - type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.struts2.json.JSONException: org.apache.struts2.json.JSONException: java.lang.

org.apache.struts2.json.JSONException: java.lang.reflect.InvocationTargetException异常解决

org.apache.struts2.json.JSONException: java.lang.reflect.InvocationTargetException org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:246) org.apache.struts2.json.JSONWriter.processCustom(JSONWriter.java:178) org.apache.struts2.json.JSONWriter.p

含有Date类型属性的实体类转化为JSONArray时报net.sf.json.JSONException: java.lang.reflect.InvocationTargetException

当我们通过session传递数据的时候我通常是: 直接在DAO里从数据库取出含Date类型的数据,而且通常不会将java.sql.Date转为java.util.Date. 这时候前台和后台都不会有任何问题,所以我们以为这样是正常的操作. 但是当我们用JSON传递数据的时候就会发现控制台会报一下错误信息: net.sf.json.JSONException: java.lang.reflect.InvocationTargetException 这时候我们可以再DAO里将java.sql.Dat

net.at.json.JSONException

1.错误描述 严重:Servlet.service() for servlet [clientServlet] in context with path [/User] threw exception net.at.json.JSONException:JSONArray text must start with '[' at character 1 of 127.0.0.1 2.错误原因 JSONArray json = JSONArray.fromObject(ip); 在servlet传参

net.sf.json.JSONException: &#39;object&#39; is an array. Use JSONArray instead

list集合转换JSON出错误 意思是:对象"是一个数组.使用jsonarray代替. 解决方法: 将JSONObject替换为JSONArray 代码: JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); JSONArray json = JSONArray.fromObject(newList, jsonConfig);

net.sf.json.JSONException: &amp;#39;object&amp;#39; is an array. Use JSONArray instead

list集合转换JSON出错误 意思是:对象"是一个数组. 使用jsonarray取代. 解决方法: 将JSONObject替换为JSONArray 代码: JsonConfig jsonConfig = new JsonConfig(); jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.LENIENT); JSONArray json = JSONArray.fromObject(newList, jsonConfig);