lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shawn Heisey (JIRA)" <>
Subject [jira] [Commented] (SOLR-9497) HttpSolrClient.Builder Returns Unusable Connection
Date Tue, 13 Sep 2016 00:27:20 GMT


Shawn Heisey commented on SOLR-9497:

bq. Type 'org/apache/http/impl/client/SystemDefaultHttpClient' (current frame, stack\[0\])
is not assignable to 'org/apache/http/impl/client/CloseableHttpClient' (from method signature)

The SystemDefaultHttpClient class was introduced in HttpClient 4.2, and subsequently deprecated
in HttpClient 4.3.  The CloseableHttpClient class was introduced in HttpClient 4.3.  As of
6.2.0, SolrJ's source code uses *both* SystemDefaultHttpClient and CloseableHttpClient.  SystemDefaultHttpClient
is a derivative class descending from CloseableHttpClient, and SolrJ 6.2.0 uses this inheritance
when passing objects.

My best guess (which I admit could be wrong) is that you've got HttpClient 4.2.x jars on your
classpath, either as a version-specific dependency from something else in your POM, or from
jars being loaded when your application starts.  HttpClient 4.2 will not know about CloseableHttpClient,
and probably would result in the error you are seeing.

Using a Builder call just like yours, with a project classpath that includes SolrJ 6.2.0 and
is *known* to be clean, I have no issues. Based on what I have seen so far, this is NOT a
Solr problem.  It is a problem with your specific development or execution environment.

As Erick already mentioned, this question belongs on the solr-user mailing list, or in the
#solr IRC channel.  It does not belong in Jira until the problem has been investigated and
determined to be a bug.

If you want to continue discussing this beyond this reply, please take the discussion to the
mailng list or IRC channel.

> HttpSolrClient.Builder Returns Unusable Connection
> --------------------------------------------------
>                 Key: SOLR-9497
>                 URL:
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: clients - java
>    Affects Versions: 6.2
>         Environment: Java 1.8 Mac OSX
>            Reporter: Will McGinnis
>              Labels: SolrJ
>             Fix For: 6.1.1
> SolrClient solr = new HttpSolrClient.Builder(urlString).build();
> Exception in thread "main" java.lang.VerifyError: Bad return type
> Exception Details:
>   Location:
>  org/apache/solr/client/solrj/impl/HttpClientUtil.createClient(Lorg/apache/solr/common/params/SolrParams;Lorg/apache/http/conn/ClientConnectionManager;)Lorg/apache/http/impl/client/CloseableHttpClient;
@58: areturn
>   Reason:
>     Type 'org/apache/http/impl/client/DefaultHttpClient' (current frame, stack[0]) is
not assignable to 'org/apache/http/impl/client/CloseableHttpClient' (from method signature)
>   Current Frame:
>     bci: @58
>     flags: { }
>     locals: { 'org/apache/solr/common/params/SolrParams', 'org/apache/http/conn/ClientConnectionManager',
'org/apache/solr/common/params/ModifiableSolrParams', 'org/apache/http/impl/client/DefaultHttpClient'
>     stack: { 'org/apache/http/impl/client/DefaultHttpClient' }
>   Bytecode:
>     0x0000000: bb00 0359 2ab7 0004 4db2 0005 b900 0601
>     0x0000010: 0099 001e b200 05bb 0007 59b7 0008 1209
>     0x0000020: b600 0a2c b600 0bb6 000c b900 0d02 002b
>     0x0000030: b800 104e 2d2c b800 0f2d b0            
>   Stackmap Table:
>     append_frame(@47,Object[#143])
> 	at org.apache.solr.client.solrj.impl.HttpSolrClient.<init>(
> 	at org.apache.solr.client.solrj.impl.HttpSolrClient$
> I have tried upgrading to httpclient-4.5.2. This appears to create the same problem.
For now, I use this deprecated, connection code.
> return new HttpSolrClient(urlString, new SystemDefaultHttpClient());
> Eventually, this hangs the Solr server, because you run out of file handles.
> I suspect calling solrClient.close() is doing nothing.
> I tried not closing and using a static connection to Solr.
> This results in basically, the same problem of, eventually hanging the Solr server.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message