参考http://blog.csdn.net/jawsy/archive/2007/04/09/1557165.aspx做json的测试,但是发现报错,具体错误为
报错:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ListOrderedMap
at net.sf.json.JSONObject.<init>(JSONObject.java:1529)
at net.sf.json.util.CycleDetectionStrategy.<clinit>(CycleDetectionStrategy.java:37)
at net.sf.json.JsonConfig.<clinit>(JsonConfig.java:58)
at net.sf.json.JSONArray.fromObject(JSONArray.java:127)
at JsonTest.main(JsonTest.java:8)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.ListOrderedMap
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.C