Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

SOLR-991 -- Better error message when parsing solrconfig.xml fails due to malformed XML. Error message notes the name of the file being parsed.

Shalin Shekhar Mangarcaf1fc27252a
diff --git a/CHANGES.txt b/CHANGES.txt
index 8765b737f3a..e2ecaf212ad 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -223,6 +223,9 @@ Bug Fixes
26. SOLR-883: Implicit properties are not set for Cores created through CoreAdmin (Noble Paul via shalin)
+27. SOLR-991: Better error message when parsing solrconfig.xml fails due to malformed XML. Error message notes the name
+ of the file being parsed. (Michael Henson via shalin)
+
Other Changes
----------------------
diff --git a/example/solr/conf/schema.xml b/example/solr/conf/schema.xml
index 3b941195c56..833dd8eae74 100755
--- a/example/solr/conf/schema.xml
+++ b/example/solr/conf/schema.xml
@@ -30,7 +30,7 @@
NOTE: this schema includes many optional features and should not
be used for benchmarking.
--->
+-- >
<schema name="example" version="1.1">
<!-- attribute "name" is the name of this schema and is only used for display purposes.
diff --git a/src/java/org/apache/solr/core/Config.java b/src/java/org/apache/solr/core/Config.java
index 94e68887edd..ad92b8bd0f8 100644
--- a/src/java/org/apache/solr/core/Config.java
+++ b/src/java/org/apache/solr/core/Config.java
@@ -104,6 +104,12 @@ public class Config {
doc = builder.parse(lis);
DOMUtil.substituteProperties(doc, loader.getCoreProperties());
+ } catch (ParserConfigurationException e) {
+ SolrException.log(log, "Exception during parsing file: " + name, e);
+ throw e;
+ } catch (SAXException e) {
+ SolrException.log(log, "Exception during parsing file: " + name, e);
+ throw e;
} catch( SolrException e ){
SolrException.log(log,"Error in "+name,e);
throw e;