From 2ddd39225acfa0db6640acf74ae70c9c3f4e7384 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Thu, 17 May 2007 03:40:17 +0000 Subject: [PATCH] SOLR-241: Undefined system properties used in configuration files now cause a clear message to be logged rather than an obscure exception thrown. git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@538800 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 6 +++++- src/java/org/apache/solr/core/Config.java | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ee9d4fde241..afed3d14f1a 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -306,7 +306,11 @@ Bug Fixes content. Using the contentType: "text/xml; charset=utf-8" will force utf-8 encoding. If you do not specify a contentType, it will use the platform default. (Koji Sekiguchi via ryan) - + +15. SOLR-241: Undefined system properties used in configuration files now + cause a clear message to be logged rather than an obscure exception thrown. + (Koji Sekiguchi via ehatcher) + Other Changes 1. Updated to Lucene 2.1 diff --git a/src/java/org/apache/solr/core/Config.java b/src/java/org/apache/solr/core/Config.java index 036206e8fe1..aa823bb079e 100644 --- a/src/java/org/apache/solr/core/Config.java +++ b/src/java/org/apache/solr/core/Config.java @@ -64,7 +64,13 @@ public class Config { javax.xml.parsers.DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); doc = builder.parse(is); - DOMUtil.substituteSystemProperties(doc); + try{ + DOMUtil.substituteSystemProperties(doc); + } + catch( SolrException e ){ + SolrException.log(log,"Error in "+name,e); + throw e; + } } public Document getDocument() {