google-code-export / nutz

Automatically exported from code.google.com/p/nutz
Apache License 2.0
1 stars 1 forks source link

对象属性有 public Integer wait;时,Json.toJson(对象)时异常 #539

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
问题产生的条件:
如题 

发生问题的调用代码:
如题 

问题的详细说明:
如题

异常堆栈:
[main] INFO  log.Logs             - Fail to value by getter 
 java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:21)
    at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:76)
    at org.nutz.json.JsonRendering.pojo2Json(JsonRendering.java:184)
    at org.nutz.json.JsonRendering.render(JsonRendering.java:273)
    at org.nutz.json.Json.toJson(Json.java:189)
    at org.nutz.json.Json.toJson(Json.java:159)
    at org.nutz.json.Json.toJson(Json.java:145)

Exception in thread "main" java.lang.RuntimeException: Fail to invoke getter 
java.lang.Object.'wait()' because [java.lang.IllegalMonitorStateException: 
current thread not owner]: current thread not owner
    at org.nutz.lang.Lang.makeThrow(Lang.java:84)
    at org.nutz.lang.eject.EjectByGetter.eject(EjectByGetter.java:26)
    at org.nutz.json.entity.JsonEntityField.getValue(JsonEntityField.java:76)
    at org.nutz.json.JsonRendering.pojo2Json(JsonRendering.java:184)
    at org.nutz.json.JsonRendering.render(JsonRendering.java:273)
    at org.nutz.json.Json.toJson(Json.java:189)
    at org.nutz.json.Json.toJson(Json.java:159)
    at org.nutz.json.Json.toJson(Json.java:145) 

相关日志:

Original issue reported on code.google.com by zhujianm...@gmail.com on 14 Dec 2011 at 3:10

GoogleCodeExporter commented 9 years ago
恩,你的属性名也太那个了...

因为有wait()方法

你先换个名字吧

Original comment by wendal1985@gmail.com on 14 Dec 2011 at 6:59

GoogleCodeExporter commented 9 years ago

Original comment by wendal1985@gmail.com on 6 Jul 2012 at 11:48