Re: httpclient gives error

2020-10-31 Thread Shawn Heisey

On 10/31/2020 12:54 PM, Raivo Rebane wrote:
I try to use solrj in web application with eclipse tomcat but I get 
following errors





Tomcat lib contains following http jars:

-rw-rw-rw- 1 hydra hydra 326724 sept   6 21:33 httpcore-4.4.4.jar
-rw-rw-rw- 1 hydra hydra 736658 sept   6 21:33 httpclient-4.5.2.jar
-rwxrwxr-x 1 hydra hydra  21544 sept   9 11:17 
httpcore5-reactive-5.0.2.jar*

-rwxrwxr-x 1 hydra hydra 809733 sept   9 12:26 httpcore5-5.0.2.jar*
-rwxrwxr-x 1 hydra hydra 225863 sept   9 12:27 httpcore5-h2-5.0.2.jar*
-rwxrwxr-x 1 hydra hydra 145492 sept   9 12:30 httpcore5-testing-5.0.2.jar*
-rwxrwxr-x 1 hydra hydra 775798 okt    3 18:53 httpclient5-5.0.3.jar*
-rwxrwxr-x 1 hydra hydra  24047 okt    3 18:54 
httpclient5-fluent-5.0.3.jar*

-rwxrwxr-x 1 hydra hydra 259199 okt    3 18:54 httpclient5-cache-5.0.3.jar*
-rwxrwxr-x 1 hydra hydra  15576 okt    3 18:54 httpclient5-win-5.0.3.jar*
-rwxrwxr-x 1 hydra hydra  38022 okt    3 18:55 
httpclient5-testing-5.0.3.jar*

-rw-rw-r-- 1 hydra hydra  37068 okt   31 19:50 httpmime-4.3.jar


Version 5 of the apache httpclient is not used by any SolrJ version. 
Newer versions of SolrJ utilize the Jetty httpclient for http/2 support, 
not the apache httpclient.  The older client, using apache httpclient 
4.x, is still present in newer SolrJ versions.  Your message did not 
indicate which version of SolrJ you are using.  One of your previous 
emails to the list mentions version 8.6.3 of SolrJ ... the httpclient 
4.x jars that you have are different versions than that version of SolrJ 
asks for.


Looking over previous emails that you have sent to the mailing list, I 
wonder why you are adding jars manually instead of letting Maven handle 
all of the dependencies.  A common problem when dependency resolution is 
not automatic is that the classpath is missing one or more of the jars 
that exist on the filesystem.


I don't think this problem is directly caused by SolrJ.  It could be 
that the httpclient 4.x jars you have are not new enough, or there might 
be some unknown interaction between the 4.x jars and the 5.x jars.  Or 
maybe your classpath is incomplete -- doesn't include something in your 
file listing above.


Problems like this can also be caused by having multiple copies of the 
same or similar versions of jars on the classpath.  That kind of issue 
could be very hard to track down.  It can easily be caused by utilizing 
a mixture of automatic and manual dependencies.  Choose either all 
automatic (maven, ivy, gradle, etc) or all manual.


Thanks,
Shawn


httpclient gives error

2020-10-31 Thread Raivo Rebane

Hello

I try to use solrj in web application with eclipse tomcat but I get 
following errors


java.lang.NoSuchFieldError: INSTANCE
    at 
org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:52)
    at 
org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:56)
    at 
org.apache.http.impl.io.DefaultHttpRequestWriterFactory.(DefaultHttpRequestWriterFactory.java:46)
    at 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:82)
    at 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:95)
    at 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:104)
    at 
org.apache.http.impl.conn.ManagedHttpClientConnectionFactory.(ManagedHttpClientConnectionFactory.java:62)
    at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager$InternalConnectionFactory.(PoolingHttpClientConnectionManager.java:572)
    at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:174)
    at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:158)
    at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:149)
    at 
org.apache.http.impl.conn.PoolingHttpClientConnectionManager.(PoolingHttpClientConnectionManager.java:125)
    at 
org.apache.solr.client.solrj.impl.HttpClientUtil.createPoolingConnectionManager(HttpClientUtil.java:278)
    at 
org.apache.solr.client.solrj.impl.HttpClientUtil.createClient(HttpClientUtil.java:273)
    at 
org.apache.solr.client.solrj.impl.HttpSolrClient.(HttpSolrClient.java:204)
    at 
org.apache.solr.client.solrj.impl.HttpSolrClient$Builder.build(HttpSolrClient.java:968)

    at AppServServlet.init(AppServServlet.java:63)


Tomcat lib contains following http jars:

-rw-rw-rw- 1 hydra hydra 326724 sept   6 21:33 httpcore-4.4.4.jar
-rw-rw-rw- 1 hydra hydra 736658 sept   6 21:33 httpclient-4.5.2.jar
-rwxrwxr-x 1 hydra hydra  21544 sept   9 11:17 httpcore5-reactive-5.0.2.jar*
-rwxrwxr-x 1 hydra hydra 809733 sept   9 12:26 httpcore5-5.0.2.jar*
-rwxrwxr-x 1 hydra hydra 225863 sept   9 12:27 httpcore5-h2-5.0.2.jar*
-rwxrwxr-x 1 hydra hydra 145492 sept   9 12:30 httpcore5-testing-5.0.2.jar*
-rwxrwxr-x 1 hydra hydra 775798 okt    3 18:53 httpclient5-5.0.3.jar*
-rwxrwxr-x 1 hydra hydra  24047 okt    3 18:54 httpclient5-fluent-5.0.3.jar*
-rwxrwxr-x 1 hydra hydra 259199 okt    3 18:54 httpclient5-cache-5.0.3.jar*
-rwxrwxr-x 1 hydra hydra  15576 okt    3 18:54 httpclient5-win-5.0.3.jar*
-rwxrwxr-x 1 hydra hydra  38022 okt    3 18:55 
httpclient5-testing-5.0.3.jar*

-rw-rw-r-- 1 hydra hydra  37068 okt   31 19:50 httpmime-4.3.jar

 which is accesible for tomcat.

What is wrong with my application ?

Please somebody help me

Regards

Raivo