0
I have a problem. In the same code, I kind of need to use both simple.Jsonarray and json.JSONArray. I can’t import both, so I’m trying to use the simple. It turns out that when I do a request, the answer is a json that java says is simple, so I can’t use the other.
In the excerpt of the code I’m having problems, I’m reading a file. It comes back as an Object, which I need to turn into json. follows the excerpt:
JSONParser parser = new JSONParser();
JSONArray queues = (JSONArray) parser.parse(new FileReader("file.json"))
The following error appears (in the first line of the above section):
java.lang.ClassCastException: org.json.simple.JSONArray cannot be cast to org.json.JSONArray
If I use the simple of the problem elsewhere in the code. I am using mvc, so it is difficult to create a new file just to make a method...