<?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 NiFi Error: failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215256#M69162</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;
I am trying to connect Hive from Apache NiFi 1.3.0 &lt;/P&gt;&lt;P&gt;but its giving me error &lt;/P&gt;&lt;PRE&gt;SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient: java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient &lt;/PRE&gt;
&lt;PRE&gt;SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] org.apache.nifi.processors.hive.SelectHiveQL$Lambda$182/1006763062@50dd1ed1 failed to process due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient; rolling back session: java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient &lt;/PRE&gt;&lt;P&gt;Its clearly indicating that its not getting HttpClient.jar. Now i have added httpclient-4.5.2.jar in NiFi lib folder and tried to run NiFi again but NiFi failed to start. If i add any httpclient.jar in Nifi lib folder, nifi is failing to run. &lt;/P&gt;&lt;P&gt;Its giving me this error this time in NiFi-app.log &lt;/P&gt;&lt;PRE&gt;2017-10-06 05:00:00,835 ERROR [Timer-Driven Process Thread-8] org.apache.hive.jdbc.HiveConnection Error 
opening session org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! &lt;/PRE&gt;&lt;P&gt;I think its a error related to version mismatch. Now i tried with httpclient-4.3.3.jar and httpclient-4.2.3.jar, Now for httpclient-4.3.3.jar its giving the same client protocol is unset error.
And For httpclient-4.2.3.jar its giving me this error &lt;/P&gt;&lt;PRE&gt;2017-10-06 06:00:19,820 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider org.apache.nifi.processors.standard.GetHTTP could not be instantiated
java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider org.apache.nifi.processors.standard.GetHTTP could not be instantiated &lt;/PRE&gt;&lt;P&gt;Now My NiFi Settings:&lt;/P&gt;&lt;P&gt;In nifi.properties:&lt;/P&gt;&lt;P&gt; nifi.kerberos.krb5.file=/path/krb5.conf &lt;/P&gt;&lt;P&gt;In NiFi Lib folder:&lt;/P&gt;&lt;P&gt;I have added couple of libs&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;hive-jdbc-1.1.0-cdh5.7.0.jar&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;hive-service-1.1.0-cdh5.7.0.jar&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;libthrift-0.9.2.jar&lt;/P&gt;&lt;P&gt;Without this 3 libs nifi was giving other types of errors.&lt;/P&gt;&lt;P&gt;In  HiveConnectionPool Setting &lt;/P&gt;&lt;P&gt;Database Connection Url: jdbc:hive2://MyServer:10000/;principal=hive/MyServer@MyDomain &lt;/P&gt;&lt;P&gt;Hive Conf Resources: /path/core-site.xml,/path/hive-site.xml &lt;/P&gt;&lt;P&gt;DB User: &lt;/P&gt;&lt;P&gt;Password:&lt;/P&gt;&lt;P&gt;
Max Wait Time: 500 millis &lt;/P&gt;&lt;P&gt;Max Total Connections: 8 &lt;/P&gt;&lt;P&gt;Validation query: &lt;/P&gt;&lt;P&gt;Kerberos principle: hive/MyServer@MyDomain &lt;/P&gt;&lt;P&gt;Kerberos keytab: /path/keytabs/hive.service.keytab &lt;/P&gt;&lt;P&gt;for all of these above i am commonly getting a warning &lt;/P&gt;&lt;PRE&gt;SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] Processor Administratively Yielded for 1 sec due to processing failure &lt;/PRE&gt;&lt;P&gt;and an error &lt;/P&gt;&lt;PRE&gt;HiveConnectionPool[id=f0a678e0-015e-1000-1235-94651d8210e9] Kerberos Authentication for Hive failed: org.apache.nifi.util.hive.AuthenticationFailedException: Kerberos Authentication for Hive failed &lt;/PRE&gt;&lt;P&gt;After reading a similar thread  &lt;A href="https://community.hortonworks.com/questions/62014/nifi-hive-connection-pool-error.html" target="_blank"&gt;https://community.hortonworks.com/questions/62014/nifi-hive-connection-pool-error.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have added this property to Hive-site.xml . And tried to connect to hive using the "binary" transport mode.&lt;/P&gt;&lt;PRE&gt;&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;hive.server2.transport.mode&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;binary&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt; &lt;/PRE&gt;&lt;P&gt;But It still giving me same error&lt;/P&gt;&lt;PRE&gt;SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient: java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient &lt;/PRE&gt;&lt;P&gt;What should i do now? Any suggestions or Solutions&lt;/P&gt;&lt;P&gt;Thanks in advance, &lt;/P&gt;&lt;P&gt;Pratik&lt;/P&gt;</description>
    <pubDate>Sat, 07 Oct 2017 01:28:35 GMT</pubDate>
    <dc:creator>PratikGhatak</dc:creator>
    <dc:date>2017-10-07T01:28:35Z</dc:date>
    <item>
      <title>NiFi Error: failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215256#M69162</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;
I am trying to connect Hive from Apache NiFi 1.3.0 &lt;/P&gt;&lt;P&gt;but its giving me error &lt;/P&gt;&lt;PRE&gt;SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient: java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient &lt;/PRE&gt;
&lt;PRE&gt;SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] org.apache.nifi.processors.hive.SelectHiveQL$Lambda$182/1006763062@50dd1ed1 failed to process due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient; rolling back session: java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient &lt;/PRE&gt;&lt;P&gt;Its clearly indicating that its not getting HttpClient.jar. Now i have added httpclient-4.5.2.jar in NiFi lib folder and tried to run NiFi again but NiFi failed to start. If i add any httpclient.jar in Nifi lib folder, nifi is failing to run. &lt;/P&gt;&lt;P&gt;Its giving me this error this time in NiFi-app.log &lt;/P&gt;&lt;PRE&gt;2017-10-06 05:00:00,835 ERROR [Timer-Driven Process Thread-8] org.apache.hive.jdbc.HiveConnection Error 
opening session org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! &lt;/PRE&gt;&lt;P&gt;I think its a error related to version mismatch. Now i tried with httpclient-4.3.3.jar and httpclient-4.2.3.jar, Now for httpclient-4.3.3.jar its giving the same client protocol is unset error.
And For httpclient-4.2.3.jar its giving me this error &lt;/P&gt;&lt;PRE&gt;2017-10-06 06:00:19,820 ERROR [main] org.apache.nifi.NiFi Failure to launch NiFi due to java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider org.apache.nifi.processors.standard.GetHTTP could not be instantiated
java.util.ServiceConfigurationError: org.apache.nifi.processor.Processor: Provider org.apache.nifi.processors.standard.GetHTTP could not be instantiated &lt;/PRE&gt;&lt;P&gt;Now My NiFi Settings:&lt;/P&gt;&lt;P&gt;In nifi.properties:&lt;/P&gt;&lt;P&gt; nifi.kerberos.krb5.file=/path/krb5.conf &lt;/P&gt;&lt;P&gt;In NiFi Lib folder:&lt;/P&gt;&lt;P&gt;I have added couple of libs&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;hive-jdbc-1.1.0-cdh5.7.0.jar&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;hive-service-1.1.0-cdh5.7.0.jar&lt;/P&gt;&lt;P style="margin-left: 20px;"&gt;libthrift-0.9.2.jar&lt;/P&gt;&lt;P&gt;Without this 3 libs nifi was giving other types of errors.&lt;/P&gt;&lt;P&gt;In  HiveConnectionPool Setting &lt;/P&gt;&lt;P&gt;Database Connection Url: jdbc:hive2://MyServer:10000/;principal=hive/MyServer@MyDomain &lt;/P&gt;&lt;P&gt;Hive Conf Resources: /path/core-site.xml,/path/hive-site.xml &lt;/P&gt;&lt;P&gt;DB User: &lt;/P&gt;&lt;P&gt;Password:&lt;/P&gt;&lt;P&gt;
Max Wait Time: 500 millis &lt;/P&gt;&lt;P&gt;Max Total Connections: 8 &lt;/P&gt;&lt;P&gt;Validation query: &lt;/P&gt;&lt;P&gt;Kerberos principle: hive/MyServer@MyDomain &lt;/P&gt;&lt;P&gt;Kerberos keytab: /path/keytabs/hive.service.keytab &lt;/P&gt;&lt;P&gt;for all of these above i am commonly getting a warning &lt;/P&gt;&lt;PRE&gt;SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] Processor Administratively Yielded for 1 sec due to processing failure &lt;/PRE&gt;&lt;P&gt;and an error &lt;/P&gt;&lt;PRE&gt;HiveConnectionPool[id=f0a678e0-015e-1000-1235-94651d8210e9] Kerberos Authentication for Hive failed: org.apache.nifi.util.hive.AuthenticationFailedException: Kerberos Authentication for Hive failed &lt;/PRE&gt;&lt;P&gt;After reading a similar thread  &lt;A href="https://community.hortonworks.com/questions/62014/nifi-hive-connection-pool-error.html" target="_blank"&gt;https://community.hortonworks.com/questions/62014/nifi-hive-connection-pool-error.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I have added this property to Hive-site.xml . And tried to connect to hive using the "binary" transport mode.&lt;/P&gt;&lt;PRE&gt;&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;hive.server2.transport.mode&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;binary&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt; &lt;/PRE&gt;&lt;P&gt;But It still giving me same error&lt;/P&gt;&lt;PRE&gt;SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] SelectHiveQL[id=f0a5404d-015e-1000-9cda-00f1242476aa] failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient: java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient &lt;/PRE&gt;&lt;P&gt;What should i do now? Any suggestions or Solutions&lt;/P&gt;&lt;P&gt;Thanks in advance, &lt;/P&gt;&lt;P&gt;Pratik&lt;/P&gt;</description>
      <pubDate>Sat, 07 Oct 2017 01:28:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215256#M69162</guid>
      <dc:creator>PratikGhatak</dc:creator>
      <dc:date>2017-10-07T01:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Error: failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215257#M69163</link>
      <description>&lt;P style="margin-left: 40px;"&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/45353/pratikghatak.html" nodeid="45353"&gt;@Pratik Ghatak&lt;/A&gt;&lt;BR /&gt;This looks like what happens when you try to connect NiFi to an old fork of Hive like the one in CDH, I have an article about it here: &lt;A href="https://community.hortonworks.com/articles/93771/connecting-nifi-to-cdh-hive.html" target="_blank"&gt;https://community.hortonworks.com/articles/93771/connecting-nifi-to-cdh-hive.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;There's an excellent comment from &lt;A rel="user" href="https://community.cloudera.com/users/18060/rudolfschimmel.html" nodeid="18060"&gt;@Rudolf Schimmel&lt;/A&gt; on a workaround at the bottom of that post if you are in the same situation, but give it a read and let me know if you need help with an alternative solution. &lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 20:22:58 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215257#M69163</guid>
      <dc:creator>dchaffey</dc:creator>
      <dc:date>2017-10-16T20:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Error: failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215258#M69164</link>
      <description>&lt;P&gt;Check out:   &lt;A href="https://community.hortonworks.com/articles/93771/connecting-nifi-to-cdh-hive.html" target="_blank"&gt;https://community.hortonworks.com/articles/93771/connecting-nifi-to-cdh-hive.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This is due to Apache Hive 1.1 and Apache NiFi using Apache Hive 1.2.&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 20:27:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215258#M69164</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2017-10-16T20:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Error: failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215259#M69165</link>
      <description>&lt;P&gt;&lt;A href="https://community.hortonworks.com/questions/64463/selecthiveql-processor-hive-connection-pool-config.html" target="_blank"&gt;https://community.hortonworks.com/questions/64463/selecthiveql-processor-hive-connection-pool-config.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Oct 2017 20:50:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215259#M69165</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2017-10-16T20:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Error: failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215260#M69166</link>
      <description>&lt;P&gt;Thanks for the Help. Its working.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 21:09:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215260#M69166</guid>
      <dc:creator>PratikGhatak</dc:creator>
      <dc:date>2017-10-23T21:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Error: failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215261#M69167</link>
      <description>&lt;P&gt;Its working using DBCPConnectionPool.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2017 21:27:11 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215261#M69167</guid>
      <dc:creator>PratikGhatak</dc:creator>
      <dc:date>2017-10-23T21:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi Error: failed to process session due to java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215262#M69168</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/45353/pratikghatak.html" nodeid="45353"&gt;@Pratik Ghatak&lt;/A&gt; &lt;A rel="user" href="https://community.cloudera.com/users/18060/rudolfschimmel.html" nodeid="18060"&gt;@Rudolf Schimmel&lt;/A&gt; &lt;A rel="user" href="https://community.cloudera.com/users/9304/tspann.html" nodeid="9304"&gt;@Timothy Spann&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I am getting the similar error while connecting to Hive using DBCPConnectionPool in ExecuteSQL processor in NiFi 1.7.1&lt;BR /&gt;Hive version : Hive 1.1.0-cdh5.12.0&lt;BR /&gt;&lt;BR /&gt;My DBCP Connection Pool:&lt;BR /&gt;DB Connection URL: jdbc:hive2://MyServer:10000/default;AuthMech=GSSAPI;KrbRealm=HADOOP.TEST.COMPANY.COM;KrbHostFQDN=_HOST;KrbServiceName=hive &lt;/P&gt;&lt;P&gt;DB Driver Location: /opt/flow/nifi/lib/hive-jdbc-1.1.0-cdh5.12.0.jar, /opt/flow/nifi/lib/hive-service-1.1.0-cdh5.12.0.jar, /opt/flow/nifi/lib/libthrift-0.9.3.jar &lt;/P&gt;&lt;P&gt;DB Driver Class: org.apache.hive.jdbc.Hive&lt;/P&gt;&lt;P&gt;Driver Database User : No value set &lt;/P&gt;&lt;P&gt;Password : No value set&lt;/P&gt;&lt;P&gt;Further, &lt;/P&gt;&lt;P&gt;I have added below property in hive-site.xml &lt;/P&gt;&lt;P&gt;&amp;lt;property&amp;gt; &lt;/P&gt;&lt;P&gt;  &amp;lt;name&amp;gt;hive.server2.transport.mode&amp;lt;/name&amp;gt; &lt;/P&gt;&lt;P&gt;   &amp;lt;value&amp;gt;binary&amp;lt;/value&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;lt;property&amp;gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;If possible, could you please share your working DBCPConnection Pool settings. &lt;/P&gt;&lt;P&gt;I am able to connect to Hive in Python using pyhs2 and impala.dbapi modules providing &lt;/P&gt;&lt;P&gt;pyhs2.connect(host='myserver',port=10000,authMechanism='KERBEROS')&lt;BR /&gt;conn=connect(host='myserver', port=10000, kerberos_service_name='hive', auth_mechanism='GSSAPI')&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Kindly advise. Thanks so much.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 04:02:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/NiFi-Error-failed-to-process-session-due-to-java-lang/m-p/215262#M69168</guid>
      <dc:creator>rishisaxena2018</dc:creator>
      <dc:date>2018-12-18T04:02:39Z</dc:date>
    </item>
  </channel>
</rss>

