Eugene Chung created HIVE-23276:
-----------------------------------

             Summary: remove HttpException NPE possibility 
                 Key: HIVE-23276
                 URL: https://issues.apache.org/jira/browse/HIVE-23276
             Project: Hive
          Issue Type: Bug
          Components: JDBC
            Reporter: Eugene Chung
            Assignee: Eugene Chung


{code:java}
java.lang.NullPointerException: null
  at org.apache.http.HttpException.clean(HttpException.java:48) 
~[httpcore-4.4.10.jar:4.4.10]
  at org.apache.http.HttpException.<init>(HttpException.java:105) 
~[httpcore-4.4.10.jar:4.4.10]
  at 
org.apache.hive.jdbc.HttpKerberosRequestInterceptor.addHttpAuthHeader(HttpKerberosRequestInterceptor.java:67)
 ~[hive-jdbc-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at 
org.apache.hive.jdbc.HttpRequestInterceptorBase.process(HttpRequestInterceptorBase.java:74)
 ~[hive-jdbc-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at 
org.apache.http.protocol.ImmutableHttpProcessor.process(ImmutableHttpProcessor.java:133)
 ~[httpcore-4.4.10.jar:4.4.10]
  at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:183) 
~[httpclient-4.5.6.jar:4.5.6]
  at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) 
~[httpclient-4.5.6.jar:4.5.6]
  at 
org.apache.http.impl.execchain.ServiceUnavailableRetryExec.execute(ServiceUnavailableRetryExec.java:85)
 ~[httpclient-4.5.6.jar:4.5.6]
  at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110) 
~[httpclient-4.5.6.jar:4.5.6]
  at 
org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
 ~[httpclient-4.5.6.jar:4.5.6]
  at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:118)
 ~[httpclient-4.5.6.jar:4.5.6]
  at 
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
 ~[httpclient-4.5.6.jar:4.5.6]
  at 
org.apache.thrift.transport.THttpClient.flushUsingHttpClient(THttpClient.java:251)
 ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.thrift.transport.THttpClient.flush(THttpClient.java:313) 
~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:73) 
~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) 
~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at 
org.apache.hive.service.rpc.thrift.TCLIService$Client.send_OpenSession(TCLIService.java:170)
 ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at 
org.apache.hive.service.rpc.thrift.TCLIService$Client.OpenSession(TCLIService.java:162)
 ~[hive-exec-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:862) 
~[hive-jdbc-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:320) 
[hive-jdbc-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:94) 
[hive-jdbc-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at java.sql.DriverManager.getConnection(DriverManager.java:664) [?:1.8.0_191]
  at java.sql.DriverManager.getConnection(DriverManager.java:208) [?:1.8.0_191]
  at 
org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:145) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at 
org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:209)
 [hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.Commands.connect(Commands.java:1679) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.Commands.connect(Commands.java:1574) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191]
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_191]
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:1.8.0_191]
  at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191]
  at 
org.apache.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:57)
 [hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1494) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1533) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:1393) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1163) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:1111) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:555) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at org.apache.hive.beeline.BeeLine.main(BeeLine.java:537) 
[hive-beeline-4.0.0-SNAPSHOT.jar:4.0.0-SNAPSHOT]
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191]
  at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_191]
  at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:1.8.0_191]
  at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_191]
  at org.apache.hadoop.util.RunJar.run(RunJar.java:318) 
[hadoop-common-3.1.2.jar:?]
  at org.apache.hadoop.util.RunJar.main(RunJar.java:232) 
[hadoop-common-3.1.2.jar:?]
{code}
As you can see in the exception trace, HttpException of httpcore always makes 
NullPointerException when the message parameter is null.

https://github.com/apache/httpcomponents-core/blob/975b373b6e0431ba8f58abe004039f925703a808/httpcore/src/main/java/org/apache/http/HttpException.java#L48



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to