NutzCN Logo
短点 toJson()方法执行报异常。
发布于 3320天前 作者 qq_561f5fd6 2622 次浏览 复制 上一个帖子 下一个帖子
标签: json
执行这个方法报异常,排查了下原因,是因为方法的名称是 toJson() 造成的,改成其他名称就好了,这应该是个bug。
```js\n
public String toJson() {
    return String.format("/*%s*/%s", super.toString(),
         Json.toJson(this, JsonFormat.compact()));

}
\n```

at com.young.seagull.base.BaseBean.toJson(BaseBean.java:44)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:236)
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:125)
at org.nutz.json.Json.toJson(Json.java:225)
at org.nutz.json.Json.toJson(Json.java:187)
at com.young.seagull.base.BaseBean.toJson(BaseBean.java:44)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:236)
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:125)
at org.nutz.json.Json.toJson(Json.java:225)
at org.nutz.json.Json.toJson(Json.java:187)
at com.young.seagull.base.BaseBean.toJson(BaseBean.java:44)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:236)
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:125)
at org.nutz.json.Json.toJson(Json.java:225)
at org.nutz.json.Json.toJson(Json.java:187)
at com.young.seagull.base.BaseBean.toJson(BaseBean.java:44)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:236)
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:125)
at org.nutz.json.Json.toJson(Json.java:225)
at org.nutz.json.Json.toJson(Json.java:187)
at com.young.seagull.base.BaseBean.toJson(BaseBean.java:44)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:236)
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:125)
at org.nutz.json.Json.toJson(Json.java:225)
at org.nutz.json.Json.toJson(Json.java:187)
at com.young.seagull.base.BaseBean.toJson(BaseBean.java:44)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:236)
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:125)
at org.nutz.json.Json.toJson(Json.java:225)
at org.nutz.json.Json.toJson(Json.java:187)
at com.young.seagull.base.BaseBean.toJson(BaseBean.java:44)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:236)
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:125)
at org.nutz.json.Json.toJson(Json.java:225)
at org.nutz.json.Json.toJson(Json.java:187)
at com.young.seagull.base.BaseBean.toJson(BaseBean.java:44)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.nutz.json.impl.JsonRenderImpl.pojo2Json(JsonRenderImpl.java:236)
at org.nutz.json.impl.JsonRenderImpl.render(JsonRenderImpl.java:125)
at org.nutz.json.Json.toJson(Json.java:225)
at org.nutz.json.Json.toJson(Json.java:187)
1 回复

测试一下回复

添加回复
请先登陆
回到顶部