wangyao5 / json-smart

Automatically exported from code.google.com/p/json-smart
0 stars 0 forks source link

No Getter for field scale in class java.math.BigDecimal #53

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. jsonObj = JSONValue.parseStrict(builder.toString()) // Fine,jsonObject 
generated
2. jsonObj.toJSONString(); // exception
3.

What is the expected output? What do you see instead?
It's expected the String. Fail by an exception.

What version of the product are you using? On what operating system?
net.minidev:json-smart:2.1.1 MacOsX Yosemite, Android Studio.

Please provide any additional information below.
02-25 11:59:19.101  13273-13455/com.gofindit.london.proappuk 
E/com.gofindit.manager.DataManager﹕ java.lang.RuntimeException: no Getter for 
field scale in class java.math.BigDecimal
            at net.minidev.asm.BeansAccessBuilder.bulid(BeansAccessBuilder.java:214)
            at net.minidev.asm.BeansAccess.get(BeansAccess.java:111)
            at net.minidev.json.reader.BeansWriterASM.writeJSONString(BeansWriterASM.java:17)
            at net.minidev.json.JSONValue.writeJSONString(JSONValue.java:596)
            at net.minidev.json.reader.JsonWriter$5.writeJSONString(JsonWriter.java:108)
            at net.minidev.json.reader.JsonWriter$5.writeJSONString(JsonWriter.java:94)
            at net.minidev.json.JSONArray.writeJSONString(JSONArray.java:75)
            at net.minidev.json.JSONArray.writeJSONString(JSONArray.java:119)
            at net.minidev.json.reader.JsonWriter$2.writeJSONString(JsonWriter.java:78)
            at net.minidev.json.reader.JsonWriter$2.writeJSONString(JsonWriter.java:76)
            at net.minidev.json.JSONValue.writeJSONString(JSONValue.java:596)
            at net.minidev.json.reader.JsonWriter.writeJSONKV(JsonWriter.java:354)
            at net.minidev.json.reader.JsonWriter$7.writeJSONString(JsonWriter.java:141)
            at net.minidev.json.reader.JsonWriter$7.writeJSONString(JsonWriter.java:123)
            at net.minidev.json.JSONObject.writeJSON(JSONObject.java:171)
            at net.minidev.json.JSONObject.writeJSONString(JSONObject.java:185)
            at net.minidev.json.reader.JsonWriter$2.writeJSONString(JsonWriter.java:78)
            at net.minidev.json.reader.JsonWriter$2.writeJSONString(JsonWriter.java:76)
            at net.minidev.json.JSONValue.writeJSONString(JSONValue.java:596)
            at net.minidev.json.reader.JsonWriter.writeJSONKV(JsonWriter.java:354)
            at net.minidev.json.reader.JsonWriter$7.writeJSONString(JsonWriter.java:141)
            at net.minidev.json.reader.JsonWriter$7.writeJSONString(JsonWriter.java:123)
            at net.minidev.json.JSONObject.writeJSON(JSONObject.java:171)
            at net.minidev.json.JSONObject.writeJSONString(JSONObject.java:185)
            at net.minidev.json.reader.JsonWriter$2.writeJSONString(JsonWriter.java:78)
            at net.minidev.json.reader.JsonWriter$2.writeJSONString(JsonWriter.java:76)
            at net.minidev.json.JSONValue.writeJSONString(JSONValue.java:596)
            at net.minidev.json.reader.JsonWriter$5.writeJSONString(JsonWriter.java:108)
            at net.minidev.json.reader.JsonWriter$5.writeJSONString(JsonWriter.java:94)
            at net.minidev.json.JSONArray.writeJSONString(JSONArray.java:75)
            at net.minidev.json.JSONArray.writeJSONString(JSONArray.java:119)
            at net.minidev.json.reader.JsonWriter$2.writeJSONString(JsonWriter.java:78)
            at net.minidev.json.reader.JsonWriter$2.writeJSONString(JsonWriter.java:76)
            at net.minidev.json.JSONValue.writeJSONString(JSONValue.java:596)
            at net.minidev.json.reader.JsonWriter.writeJSONKV(JsonWriter.java:354)
            at net.minidev.json.reader.JsonWriter$7.writeJSONString(JsonWriter.java:141)
            at net.minidev.json.reader.JsonWriter$7.writeJSONString(JsonWriter.java:123)
            at net.minidev.json.JSONObject.writeJSON(JSONObject.java:171)
            at net.minidev.json.JSONObject.toJSONString(JSONObject.java:74)
            at net.minidev.json.JSONObject.toJSONString(JSONObject.java:245)
           ...

Original issue reported on code.google.com by fxsala...@gmail.com on 25 Feb 2015 at 11:06

GoogleCodeExporter commented 9 years ago
I dont know the datas included in "builder"

Original comment by uriel.chemouni on 11 Mar 2015 at 9:09

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Any idea what causes this? It happens 3 to 5 times I run the code.

Original comment by ampof...@gmail.com on 5 Jun 2015 at 3:03

GoogleCodeExporter commented 9 years ago
This is my code.

JSONArray jarr = JsonPath.parse(json).read("$[?(@.name=='test')]");
String s = jarr.toJSONString();
System.out.println(s);

Original comment by ampof...@gmail.com on 5 Jun 2015 at 3:06