<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Connect hive with zookeeper in java in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171698#M57909</link>
    <description>&lt;P&gt;@Jay SenSharma, can you tell the exact version where this issue was fixed i am currently using 2.4.0.0-169, when if i use 1.2.1000.2.5.0.0-1245, i am getting other errors like hiveserver2 not starting or some zookeeper error. is this &lt;A href="https://issues.apache.org/jira/browse/HIVE-11581" target="_blank"&gt;https://issues.apache.org/jira/browse/HIVE-11581&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 03 Aug 2017 16:08:52 GMT</pubDate>
    <dc:creator>sujoy_neogi</dc:creator>
    <dc:date>2017-08-03T16:08:52Z</dc:date>
    <item>
      <title>Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171688#M57899</link>
      <description>&lt;P&gt;String url = "jdbc:hive2://huge-agent02:10000/";&lt;/P&gt;&lt;P&gt;Class.forName(driverName); &lt;/P&gt;&lt;P&gt;conn =(Connection) DriverManager.getConnection(url, "hive", "hive");&lt;/P&gt;&lt;P&gt;when i replace url to zookeeper url (jdbc:hive2://huge-server:2181,huge-agent02:2181,huge-agent01:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2), it can not connected hive,why?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 15:05:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171688#M57899</guid>
      <dc:creator>358524408</dc:creator>
      <dc:date>2017-03-23T15:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171689#M57900</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;@Ye Jun&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Are you passing the driverName as "&lt;EM&gt;org.apache.hive.jdbc.HiveDriver&lt;/EM&gt;" ?&lt;/P&gt;&lt;P&gt;Also when you say with the mentioned url it can not connect .... does it mean that you are getting any error?   Or is it getting hung for a long time?&lt;/P&gt;&lt;P&gt;Are the host names resolvable from the host where you are running the code?  &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example: (from Client machine)
&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;# telnet huge-server  2181
# telnet huge-agent02  2181
# telnet huge-agent01 2181&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 17:48:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171689#M57900</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-23T17:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171690#M57901</link>
      <description>&lt;P&gt;Exception in thread "main" java.lang.NullPointerException
at org.apache.thrift.transport.TSocket.open(TSocket.java:170)
at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:266)
at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:204)
at org.apache.hive.jdbc.HiveConnection.&amp;lt;init&amp;gt;(HiveConnection.java:176)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
at java.sql.DriverManager.getConnection(DriverManager.java:571)
at java.sql.DriverManager.getConnection(DriverManager.java:215)
at com.hugedata.hive.HiveJdbcConnect.getConnection(HiveJdbcConnect.java:19)
at com.hugedata.hive.HiveTest.main(HiveTest.java:12)&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 17:50:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171690#M57901</guid>
      <dc:creator>358524408</dc:creator>
      <dc:date>2017-03-23T17:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171691#M57902</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/3418/jsensharma.html"&gt;Jay SenSharma&lt;/A&gt;,this is my java code&lt;/P&gt;&lt;P&gt;public class HiveJdbcConnect { &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;
private static String driverName = "org.apache.hive.jdbc.HiveDriver";&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;private static String url = "jdbc:hive2://huge-server:2181,huge-agent02:2181,huge-agent01:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2";&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;
private static Connection conn = null;&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt; 

public static Connection getConnection(){&lt;/P&gt;&lt;P style="margin-left: 40px;"&gt;
if (conn == null) {&lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;
try {&lt;/P&gt;&lt;P style="margin-left: 80px;"&gt;
Class.forName(driverName);&lt;/P&gt;&lt;P style="margin-left: 80px;"&gt;  
conn =(Connection) DriverManager.getConnection(url, "hive", "hive"); &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;} catch (ClassNotFoundException e){ &lt;/P&gt;&lt;P style="margin-left: 80px;"&gt;            e.printStackTrace(); &lt;/P&gt;&lt;P style="margin-left: 80px;"&gt; 
            return null;&lt;/P&gt;&lt;P style="margin-left: 60px;"&gt;  
} catch (SQLException e) {&lt;/P&gt;&lt;P style="margin-left: 80px;"&gt;
    e.printStackTrace(); &lt;/P&gt;&lt;P style="margin-left: 80px;"&gt; 
    return null; &lt;/P&gt;&lt;P style="margin-left: 60px;"&gt; 
} &lt;/P&gt;&lt;P style="margin-left: 40px;"&gt; 
} &lt;/P&gt;&lt;P style="margin-left: 20px;"&gt; 
return conn;&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;  
}&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 17:56:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171691#M57902</guid>
      <dc:creator>358524408</dc:creator>
      <dc:date>2017-03-23T17:56:13Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171692#M57903</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;@Ye Jun
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I see that some issues were reported with the "hive-jdbc" driver version jar. So can you please clarify which exact version of this jar are you using. &lt;/P&gt;&lt;P&gt;As i am able to run my test successfully at my end (for example i am using "http://repo.hortonworks.com/content/repositories/releases/org/apache/hive/hive-jdbc/1.2.1000.2.5.3.0-37/" )&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:01:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171692#M57903</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-23T18:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171693#M57904</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;@Ye Jun
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Try using a different version of "hive-jdbc" driver jar for example i am using "&lt;A href="http://repo.hortonworks.com/content/repositories/releases/org/apache/hive/hive-jdbc/1.2.1000.2.5.3.0-37"&gt;http://repo.hortonworks.com/content/repositories/releases/org/apache/hive/hive-jdbc/1.2.1000.2.5.3.0-37&lt;/A&gt;/"&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:08:14 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171693#M57904</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-23T18:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171694#M57905</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;@Ye Jun
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have uploaded a sample with the "pom.xml" for version check in the github repo:  &lt;A href="https://github.com/jaysensharma/MiddlewareMagicDemos/tree/master/HDP_Ambari/Hive/HiveJavaClient" target="_blank"&gt;https://github.com/jaysensharma/MiddlewareMagicDemos/tree/master/HDP_Ambari/Hive/HiveJavaClient&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:30:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171694#M57905</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-23T18:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171695#M57906</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/3418/jsensharma.html"&gt;Jay SenSharma&lt;/A&gt;，Thanks，i&lt;STRONG&gt; try it again.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 18:32:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171695#M57906</guid>
      <dc:creator>358524408</dc:creator>
      <dc:date>2017-03-23T18:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171696#M57907</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/3418/jsensharma.html"&gt;Jay SenSharma&lt;/A&gt;, i change hive-jdbc version  to  1.2.1000.2.5.0.0-1245 ,and solved this problem, thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 08:06:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171696#M57907</guid>
      <dc:creator>358524408</dc:creator>
      <dc:date>2017-03-24T08:06:43Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171697#M57908</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;@Ye Jun
&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Good to know that the issue is resolved after changing the driver. It will be great if you can mark this HCC thread "Accepted" so that it will be useful for other users as well.
&lt;A rel="user" href="https://community.cloudera.com/users/14634/358524408.html" nodeid="14634"&gt;&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2017 08:09:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171697#M57908</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-03-24T08:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Connect hive with zookeeper in java</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171698#M57909</link>
      <description>&lt;P&gt;@Jay SenSharma, can you tell the exact version where this issue was fixed i am currently using 2.4.0.0-169, when if i use 1.2.1000.2.5.0.0-1245, i am getting other errors like hiveserver2 not starting or some zookeeper error. is this &lt;A href="https://issues.apache.org/jira/browse/HIVE-11581" target="_blank"&gt;https://issues.apache.org/jira/browse/HIVE-11581&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Aug 2017 16:08:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Connect-hive-with-zookeeper-in-java/m-p/171698#M57909</guid>
      <dc:creator>sujoy_neogi</dc:creator>
      <dc:date>2017-08-03T16:08:52Z</dc:date>
    </item>
  </channel>
</rss>

