IT/이클립스(Eclipse)
[이클립스/Eclipse] org.json.simple.JSONArray cannot be cast to org.json.simple.JSONObject 문제 해결 방법
[이클립스/Eclipse] org.json.simple.JSONArray cannot be cast to org.json.simple.JSONObject 문제 해결 방법은 Restful API를 호출하여 가져오는 데이터의 형태에 따라 Casting을 어떻게 하냐에 따라 다르다. 진짜.. 이것 때문에 삽질 오지게 했다. 이 문제에서는 org.json 패키지냐 org.json.simple 패키지냐를 잘 봐야 한다. 해결방법 내가 이 문제를 겪었던 원인은 패키지에서 org.json.simple이냐 org.json이냐에 따라 문제가 발생했다. List res = new ArrayList(); res = restApiService.getLabel(map); // List형으로 리턴 org.json.simple.J..
2022. 3. 22.
최근댓글