[json-lib-user] What causes: Property 'x' has no read method. SKIPPED?
Brought to you by:
aalmiray
From: Christopher H. <hu...@in...> - 2008-06-29 05:55:42
|
Hi there, Thanks for providing JSON-LIB. I think that it is great. I have received the following warning in my logs: WARN 2008-06-29 14:30:20,999 [connector.stdio.0.dispatcher.1] net.sf.json.JSONObject: Property 'geometryN' has no read method. SKIPPED Can you please shed some more light on what conditions cause the message to appear? Additionally is there a means to determine the class that is actually causing the problem? I'm using the Java Topology Suite and can only see two instances of its Geometry type in my code (there is a public getGeometryN(int n) method associated with the Geometry class). I also have the following setup for JSON-LIB which really should capture Geometry conversions: JsonConfig jsonConfig = new JsonConfig(); jsonConfig.registerJsonValueProcessor(Coordinate.class, new JsonValueProcessor() { public Object processArrayValue(Object arg0, JsonConfig arg1) { Coordinate coord = (Coordinate) arg0; return "{x:" + coord.x + ",y:" + coord.y + ",z:" + coord.z + "}"; } public Object processObjectValue(String arg0, Object arg1, JsonConfig arg2) { return processArrayValue(arg1, arg2); } }); jsonConfig.setCycleDetectionStrategy(CycleDetectionStrategy.NOPROP); jsonConfig.setJsonPropertyFilter(new PropertyFilter() { public boolean apply(Object source, String name, Object value) { boolean filterOut = false; if (source instanceof Geometry) { filterOut = (!name.equals("coordinates") && !name .equals("SRID")); } return filterOut; } }); JSONObject jsonObject = JSONObject.fromObject(this, jsonConfig); return jsonObject.toString(); Help is appreciated. Cheers, -C |