[ 
https://issues.apache.org/jira/browse/NIFI-1529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15187147#comment-15187147
 ] 

Alan Jackoway commented on NIFI-1529:
-------------------------------------

Maybe my issue doesn't belong on this jira. We had a custom nar that is getting 
errors that suggested we were getting an older version of httpcore or 
httpclient. Originally, our custom nar was running 4.3.1, but our stacktrace 
still had httpclient-4.4.1.jar. At that point I assumed we were being forced 
onto a newer version so we upgraded our code but are still getting ugly errors. 
If it matters, they only showed up when we went to our production deploy that 
runs in clustered mode instead of our test environments that run on single 
machines.

Let me know if you want me to move off this jira (seems like the different 
versions is not an issue).

Here are the two stacktraces we got in quick succession:
{noformat}
2016-03-08 13:06:35,725 WARN [Timer-Driven Process Thread-3] 
o.a.n.c.t.ContinuallyRunProcessorTask 
java.lang.NoSuchFieldError: INSTANCE
        at 
org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:52)
 ~[httpcore-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<init>(DefaultHttpRequestWriterFactory.java:56)
 ~[httpcore-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.io.DefaultHttpRequestWriterFactory.<clinit>(DefaultHttpRequestWriterFactory.java:46)
 ~[httpcore-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:82)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:95)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<init>(ManagedHttpClientConnectionFactory.java:104)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.<clinit>(ManagedHttpClientConnectionFactory.java:62)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:572)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:174)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:158)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:919) 
~[httpclient-4.4.1.jar:4.4.1]
        at our code
{noformat}

then 4 seconds later
{noformat}
2016-03-08 13:06:39,078 WARN [Timer-Driven Process Thread-57] 
o.a.n.c.t.ContinuallyRunProcessorTask 
java.lang.NoClassDefFoundError: Could not initialize class 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.<init>(PoolingHttpClientConnectionManager.java:572)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:174)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:158)
 ~[httpclient-4.4.1.jar:4.4.1]
        at 
org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:919) 
~[httpclient-4.4.1.jar:4.4.1]
{noformat}

The most puzzling thing about it is that the NoClassDefFoundError happened 
against a class that showed up in a stacktrace 4 seconds earlier.

> hadoop-libraries-nar dependency issue for httpclient and httpcore
> -----------------------------------------------------------------
>
>                 Key: NIFI-1529
>                 URL: https://issues.apache.org/jira/browse/NIFI-1529
>             Project: Apache NiFi
>          Issue Type: Bug
>    Affects Versions: 0.4.0, 0.5.0
>            Reporter: Bryan Bende
>            Assignee: Bryan Bende
>             Fix For: 0.6.0, 0.5.1
>
>
> The following issue was reported:
> 016-02-17 15:23:11,814 ERROR [Timer-Driven Process Thread-7] 
> o.apache.nifi.processors.hadoop.PutHDFS 
> PutHDFS[id=0575cb57-786c-45d9-b9ef-19c15cc01290] Failed to writ
> e to HDFS due to java.lang.NoClassDefFoundError: org/apache/http/Consts
> 2016-02-17 15:23:11,816 ERROR [Timer-Driven Process Thread-7] 
> o.apache.nifi.processors.hadoop.PutHDFS
> java.lang.NoClassDefFoundError: org/apache/http/Consts
>         at 
> org.apache.http.client.utils.URIBuilder.digestURI(URIBuilder.java:181) 
> ~[httpclient-4.4.1.jar:4.4.1]
>         at org.apache.http.client.utils.URIBuilder.<init>(URIBuilder.java:82) 
> ~[httpclient-4.4.1.jar:4.4.1]
>         at 
> org.apache.hadoop.crypto.key.kms.KMSClientProvider.createURL(KMSClientProvider.java:368)
>  ~[hadoop-common-2.6.2.jar:na]
> From looking into this, we have the following transitive dependencies from 
> the hadoop libraries nar:
> - net.java.dev.jets3t:jets3t:jar:0.9.0:compile
> [INFO] |  |  +- org.apache.httpcomponents:httpclient:jar:4.4.1:compile
> [INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.1.2:compile
> I believe the 4.4.1 of httpclient is coming from the top level pom which has 
> a dependency management block that forces the client to 4.4.1 and doesn't for 
> core to 4.4.1.
> If we look at httpcore 4.x branch it has the missing Consts class:
> https://github.com/apache/httpcore/tree/4.4.x/httpcore/src/main/java/org/apache/http
> and the 4.1.x branch does not:
> https://github.com/apache/httpcore/tree/4.1.x/httpcore/src/main/java/org/apache/http
> We either need to force both to 4.4.1, or force only the hadoop libraries nar 
> to both be 4.1.2 if that is what it normally brings in.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to