elliottrogasik / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

Issue when parsing #64

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi when I run the following
        jsonData = NetUtils.getHTTPFile("http://www.iobridge.com/api/feed/key=" + feedKey);
        JSONParser parser = new JSONParser();
        Object obj = null;
            //parse the JSON data
        try {
               obj = parser.parse(jsonData);
        } catch (ParseException e) {}
              JSONArray array=(JSONArray)obj;
              System.out.println(array.get(1));
              JSONObject obj2=(JSONObject)array.get(1);
              System.out.println(obj2.get("1"));

I get the following Exception
Exception in thread "main" java.lang.ClassCastException: 
org.json.simple.JSONObject
        at IOB.IOBModule.<init>(IOBModule.java:33)
        at myroomcontrol.Main.main(Main.java:30)
Java Result: 1

Original issue reported on code.google.com by callum.j...@gmail.com on 17 Feb 2009 at 9:31