Shalin Shekhar Mangar created SOLR-10886:
--------------------------------------------
Summary: Using V2Request.process(solrClient) method throws NPE if
the API returns an error
Key: SOLR-10886
URL: https://issues.apache.org/jira/browse/SOLR-10886
Project: Solr
Issue Type: Bug
Security Level: Public (Default Security Level. Issues are Public)
Components: SolrJ, v2 API
Affects Versions: master (7.0)
Reporter: Shalin Shekhar Mangar
Fix For: master (7.0)
I was trying to use the V2Request to invoke the Config API and ran into this
bug. In my case, the command had {{name}} missing but it is a required
attribute:
{code}
String addListenerCommand = "{'add-listener' : {'event':'newSearcher',
'class':'" + TestSolrEventListener.class.getName() + "'}}";
V2Request request = new
V2Request.Builder("/c/warmingTestColl/config").withMethod(SolrRequest.METHOD.POST).withPayload(addListenerCommand).build();
request.process(solrClient);
{code}
The logs show that there was an exception:
{code}
4409 INFO (qtp480792233-31) [n:127.0.0.1:35920_solr c:warmingTestColl s:shard1
r:core_node1 x:warmingTestColl_shard1_replica_n1] o.a.s.h.SolrConfigHandler
Failed to run commands. errors are {add-listener={event=newSearcher\,
class=org.apache.solr.cloud.TestCloudSearcherWarming$TestSolrEventListener}\,
errorMessages=['name' is a required field]}
{code}
But SolrJ, returned an NPE:
{code}
java.lang.NullPointerException
at
__randomizedtesting.SeedInfo.seed([312F78548DE0B0CB:B97B478E231CDD33]:0)
at
org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:160)
at
org.apache.solr.client.solrj.SolrRequest.process(SolrRequest.java:177)
{code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]