lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject svn commit: r1622569 - in /lucene/dev/trunk/solr: CHANGES.txt core/src/java/org/apache/solr/core/SolrConfig.java core/src/java/org/apache/solr/schema/IndexSchema.java core/src/test/org/apache/solr/core/TestLazyCores.java
Date Thu, 04 Sep 2014 22:07:29 GMT
Author: hossman
Date: Thu Sep  4 22:07:28 2014
New Revision: 1622569

URL: http://svn.apache.org/r1622569
Log:
SOLR-5814: CoreContainer reports incorrect & missleading path for solrconfig.xml when
there are loading problems

Modified:
    lucene/dev/trunk/solr/CHANGES.txt
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java
    lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
    lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestLazyCores.java

Modified: lucene/dev/trunk/solr/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/CHANGES.txt?rev=1622569&r1=1622568&r2=1622569&view=diff
==============================================================================
--- lucene/dev/trunk/solr/CHANGES.txt (original)
+++ lucene/dev/trunk/solr/CHANGES.txt Thu Sep  4 22:07:28 2014
@@ -167,6 +167,9 @@ Bug Fixes
 * SOLR-6297: Fix WordBreakSolrSpellChecker to not lose suggestions in shard/cloud 
   environments (James Dyer)
 
+* SOLR-5814: CoreContainer reports incorrect & missleading path for solrconfig.xml 
+  when there are loading problems (Pradeep via hossman)
+
 Other Changes
 ---------------------
 
@@ -186,6 +189,8 @@ Other Changes
 
 * SOLR-6073: Remove helper methods from CollectionsRequest (SolrJ) for CollectionsAPI
   calls and move to a builder design for the same. (Varun Thacker, Anshum Gupta)
+
+
 ==================  4.10.0 =================
 
 Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this release

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java?rev=1622569&r1=1622568&r2=1622569&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/core/SolrConfig.java Thu Sep  4 22:07:28
2014
@@ -149,7 +149,7 @@ public class SolrConfig extends Config {
       return new SolrConfig(loader, name, null);
     }
     catch (Exception e) {
-      String resource = loader.getInstanceDir() + name;
+      String resource = loader.getConfigDir() + name;
       throw new SolrException(ErrorCode.SERVER_ERROR, "Error loading solr config from " +
resource, e);
     }
   }

Modified: lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/IndexSchema.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/IndexSchema.java?rev=1622569&r1=1622568&r2=1622569&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/IndexSchema.java (original)
+++ lucene/dev/trunk/solr/core/src/java/org/apache/solr/schema/IndexSchema.java Thu Sep  4
22:07:28 2014
@@ -598,11 +598,11 @@ public class IndexSchema {
       }
     } catch (SolrException e) {
       throw new SolrException(ErrorCode.getErrorCode(e.code()), e.getMessage() + ". Schema
file is " +
-          loader.getInstanceDir() + resourceName, e);
+          loader.getConfigDir() + resourceName, e);
     } catch(Exception e) {
       // unexpected exception...
       throw new SolrException(ErrorCode.SERVER_ERROR,
-          "Schema Parsing Failed: " + e.getMessage() + ". Schema file is " + loader.getInstanceDir()
+ resourceName,
+          "Schema Parsing Failed: " + e.getMessage() + ". Schema file is " + loader.getConfigDir()
+ resourceName,
           e);
     }
 

Modified: lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestLazyCores.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestLazyCores.java?rev=1622569&r1=1622568&r2=1622569&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestLazyCores.java (original)
+++ lucene/dev/trunk/solr/core/src/test/org/apache/solr/core/TestLazyCores.java Thu Sep  4
22:07:28 2014
@@ -17,6 +17,7 @@ package org.apache.solr.core;
  * limitations under the License.
  */
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.codec.Charsets;
 import org.apache.commons.io.FileUtils;
 import org.apache.solr.SolrTestCaseJ4;
@@ -498,14 +499,10 @@ public class TestLazyCores extends SolrT
 
       // Did we get the expected message for each of the cores that failed to load? Make
sure we don't run afoul of
       // the dreaded slash/backslash difference on Windows and *nix machines.
-      testMessage(cc.getCoreInitFailures(),
-          "badConfig1" + File.separator + "solrconfig.xml");
-      testMessage(cc.getCoreInitFailures(),
-          "badConfig2" + File.separator + "solrconfig.xml");
-      testMessage(cc.getCoreInitFailures(),
-          "badSchema1" + File.separator + "schema.xml");
-      testMessage(cc.getCoreInitFailures(),
-          "badSchema2" + File.separator + "schema.xml");
+      testMessage(cc.getCoreInitFailures(), makePath("badConfig1", "conf", "solrconfig.xml"));
+      testMessage(cc.getCoreInitFailures(), makePath("badConfig2", "conf", "solrconfig.xml"));
+      testMessage(cc.getCoreInitFailures(), makePath("badSchema1", "conf", "schema.xml"));
+      testMessage(cc.getCoreInitFailures(), makePath("badSchema2", "conf", "schema.xml"));
 
       // Status should report that there are failure messages for the bad cores and none
for the good cores.
       checkStatus(cc, true, "core1");
@@ -711,6 +708,10 @@ public class TestLazyCores extends SolrT
     return new LocalSolrQueryRequest(core, new NamedList<>(entries));
   }
 
+  private static final String makePath(String... args) {
+    return StringUtils.join(args, File.separator);
+  }
+
   private final static String LOTS_SOLR_XML = " <solr persistent=\"false\"> " +
       "<cores adminPath=\"/admin/cores\" defaultCoreName=\"collectionLazy2\" transientCacheSize=\"4\">
 " +
       "<core name=\"collection1\" instanceDir=\"collection1\"  /> " +



Mime
View raw message