[ https://issues.apache.org/jira/browse/SQOOP-3244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16217951#comment-16217951 ]
Patrick Li edited comment on SQOOP-3244 at 10/25/17 1:08 AM: ------------------------------------------------------------- Hi, I have to withdraw this issue reporting because I just noticed my client API version is 1.99.6, which does not match server version 1.99.7. Sorry for confusion! Patrick was (Author: patrickli): Hi, I have to withdraw this issue reporting because I just notices my client API version is 1.99.6, which does not match server version 1.99.7. Sorry for confusion! Patrick > Raise Exception "JSONObject cannot be cast to JSONArray" during parsing > connector information > --------------------------------------------------------------------------------------------- > > Key: SQOOP-3244 > URL: https://issues.apache.org/jira/browse/SQOOP-3244 > Project: Sqoop > Issue Type: Bug > Components: sqoop2-api > Affects Versions: 1.99.7 > Environment: Java client API is used; JRE8; MacOS > Reporter: Patrick Li > Priority: Blocker > Labels: easyfix > Attachments: sqoop_client_api.png > > Original Estimate: 4h > Remaining Estimate: 4h > > The code is as below: > Class: package org.apache.sqoop.json.ConnectorBean > Method: private MConnector restoreConnector(Object obj) > code with bug: line in red > cause: The object with name "link-config" is a JSON object, not a JSON array. > It should be: > ConfigInputSerialization.restoreConfigList((JSONArray)object.get("link-config").get("configs") > !sqoop_client_api.png! > private MConnector restoreConnector(Object obj) { > JSONObject object = (JSONObject)obj; > long connectorId = ((Long)object.get("id")).longValue(); > String uniqueName = (String)object.get("name"); > String className = (String)object.get("class"); > String version = (String)object.get("version"); > List<MConfig> linkConfigs = > {color:red}ConfigInputSerialization.restoreConfigList((JSONArray)object.get("link-config"));{color} > JSONObject jobConfigJson = (JSONObject)object.get("job-config"); > JSONArray fromJobConfigJson = > (JSONArray)jobConfigJson.get(Direction.FROM.name()); > JSONArray toJobConfigJson = > (JSONArray)jobConfigJson.get(Direction.TO.name()); > MFromConfig fromConfig = null; > MToConfig toConfig = null; > List toJobConfig; > if (fromJobConfigJson != null) { > toJobConfig = > ConfigInputSerialization.restoreConfigList(fromJobConfigJson); > fromConfig = new MFromConfig(toJobConfig); > } -- This message was sent by Atlassian JIRA (v6.4.14#64029)