Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B64DCFA4E for ; Tue, 19 Mar 2013 16:35:17 +0000 (UTC) Received: (qmail 81426 invoked by uid 500); 19 Mar 2013 16:35:16 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 81364 invoked by uid 500); 19 Mar 2013 16:35:16 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 81356 invoked by uid 99); 19 Mar 2013 16:35:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Mar 2013 16:35:16 +0000 Date: Tue, 19 Mar 2013 16:35:16 +0000 (UTC) From: "Mark Miller (JIRA)" To: dev@lucene.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (SOLR-4614) ClusterState#getSlices returns null causing NPE in ClientUtils#addSlices MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SOLR-4614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13606477#comment-13606477 ] Mark Miller commented on SOLR-4614: ----------------------------------- Perhaps a NullPointer is right? Or illegal argument exception? I have not looked into what that affects, but I think I hit this same thing and went with a fix higher up of: {code} if (colSlices == null) { throw new SolrServerException("Could not find collection:" + collectionName); } {code} I guess it depends on what adding slices to a null slice means - my first thought was that it was an error. > ClusterState#getSlices returns null causing NPE in ClientUtils#addSlices > ------------------------------------------------------------------------ > > Key: SOLR-4614 > URL: https://issues.apache.org/jira/browse/SOLR-4614 > Project: Solr > Issue Type: Bug > Components: clients - java, SolrCloud > Affects Versions: 4.1 > Reporter: David Arthur > Priority: Minor > > When my program sends an UpdateRequest to a collection that has been deleted, I am getting a NPE > {code} > java.lang.NullPointerException > at org.apache.solr.client.solrj.util.ClientUtils.addSlices(ClientUtils.java:273) > at org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:214) > at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:117) > {code} > This appears to be caused by the fact that ClusterState#getSlices is returning null instead of an empty collection. > ClusterState returning null: https://github.com/apache/lucene-solr/blob/lucene_solr_4_1/solr/solrj/src/java/org/apache/solr/common/cloud/ClusterState.java#L123 > ClientUtil#addSlices iterating over a null: https://github.com/apache/lucene-solr/blob/lucene_solr_4_1/solr/solrj/src/java/org/apache/solr/client/solrj/util/ClientUtils.java#L273 > I would attach a patch, but I'm not sure what the preferred style is within the project (empty collection vs null checks). -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org