Support Questions
Find answers, ask questions, and share your expertise

Failed to connect to Hive2

Failed to connect to Hive2

Contributor

I am evaluating horton and I am trying to connect to hive2 using jdbc. I get this strange NPE.

2017-10-01 11:17:28.770  INFO 4232 --- [Pool-1-worker-1] org.apache.hive.jdbc.HiveConnection      : Will try to open client transport with JDBC Uri: 
jdbc:hive2://hive.server2.authentication=NONE;hive.server2.transport.mode=binary;hive.server2.thrift.sasl.qop=auth;hive.server2.thrift.bind.host=my-host;hive.server2.thrift.port=10000;hive.server2.use.SSL=false/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2
2017-10-01 11:17:28.770 ERROR 4232 --- [Pool-1-worker-1] c.a.h.h.controller.HiveDemoController    : java.lang.NullPointerException


java.lang.NullPointerException: null
	at org.apache.thrift.transport.TSocket.open(TSocket.java:170) ~[libthrift-0.9.2.jar:0.9.2]
	at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:266) ~[libthrift-0.9.2.jar:0.9.2]
	at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37) ~[libthrift-0.9.2.jar:0.9.2]
	at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:204) ~[hive-jdbc-1.2.1.jar:1.2.1]
	at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:176) ~[hive-jdbc-1.2.1.jar:1.2.1]
	at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105) ~[hive-jdbc-1.2.1.jar:1.2.1]
	at java.sql.DriverManager.getConnection(DriverManager.java:664) ~[na:1.8.0_144]
	at java.sql.DriverManager.getConnection(DriverManager.java:247) ~[na:1.8.0_144]
	at com.hive.hivedemo.controller.HiveDemoController.lodFileAsync(HiveDemoController.java:82) [classes/:na]
	at com.hive.hivedemo.controller.HiveDemoController.lambda$loadFile$0(HiveDemoController.java:49) [classes/:na]
	at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) ~[na:1.8.0_144]
	at java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1582) ~[na:1.8.0_144]
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[na:1.8.0_144]
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[na:1.8.0_144]
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[na:1.8.0_144]
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) ~[na:1.8.0_144]


1 REPLY 1

Re: Failed to connect to Hive2

Contributor

I upgraded to latest hive-jdbc and it resolved this issue