5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-21 03:10:49 +08:00

SQOOP-1748: Sqoop2: Client throws NPE when misconfigured for Kerberos

(Richard Zhou via Abraham Elmahrek)
This commit is contained in:
Abraham Elmahrek 2014-11-17 21:30:49 -08:00
parent 423de5d515
commit 51dd8375f3
2 changed files with 7 additions and 2 deletions

View File

@ -32,6 +32,9 @@ public enum ClientError implements ErrorCode {
/** Given connector is not known to the server **/
CLIENT_0003("Connector do not exists"),
/** The system was not able to find valid Kerberos tikcet cache (kinit). */
CLIENT_0004("Unable to find valid Kerberos ticket cache (kinit)");
;
private final String message;

View File

@ -114,14 +114,16 @@ protected String doHttpRequest(String strURL, String method, String data) {
throw new SqoopException(ClientError.CLIENT_0001, ex.getThrowable());
}
} else {
throw new SqoopException(ClientError.CLIENT_0000);
}
return result.toString();
} catch (IOException ex) {
LOG.trace("ERROR: ", ex);
return "";
throw new SqoopException(ClientError.CLIENT_0000, ex);
} catch (AuthenticationException ex) {
LOG.trace("ERROR: ", ex);
return "";
throw new SqoopException(ClientError.CLIENT_0004, ex);
} finally {
try {
if (wr != null) {