From 77d89d60372c41ff0c4fbbbe4413e1f8a41f6d08 Mon Sep 17 00:00:00 2001 From: Shalin Shekhar Mangar Date: Wed, 25 Nov 2015 15:51:56 +0000 Subject: [PATCH] SOLR-8073: Solr fails to start on Windows with obscure errors when using relative path git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1716446 13f79535-47bb-0310-9956-ffa450edef68 --- solr/CHANGES.txt | 3 +++ solr/bin/solr.cmd | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index d887f3f943b..49d76f6e7a9 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -419,6 +419,9 @@ Bug Fixes * SOLR-8307: Fix XXE vulnerability in MBeansHandler "diff" feature (Erik Hatcher) +* SOLR-8073: Solr fails to start on Windows with obscure errors when using relative path. + (Alexandre Rafalovitch, Ishan Chattopadhyaya via shalin) + Optimizations ---------------------- diff --git a/solr/bin/solr.cmd b/solr/bin/solr.cmd index 5f5f6c24b73..71273096440 100644 --- a/solr/bin/solr.cmd +++ b/solr/bin/solr.cmd @@ -609,11 +609,11 @@ IF NOT "%EXAMPLE%"=="" goto run_example :start_solr IF "%SOLR_HOME%"=="" set "SOLR_HOME=%SOLR_SERVER_DIR%\solr" +IF EXIST "%cd%\%SOLR_HOME%" set "SOLR_HOME=%cd%\%SOLR_HOME%" + IF NOT EXIST "%SOLR_HOME%\" ( IF EXIST "%SOLR_SERVER_DIR%\%SOLR_HOME%" ( set "SOLR_HOME=%SOLR_SERVER_DIR%\%SOLR_HOME%" - ) ELSE IF EXIST "%cd%\%SOLR_HOME%" ( - set "SOLR_HOME=%cd%\%SOLR_HOME%" ) ELSE ( set "SCRIPT_ERROR=Solr home directory %SOLR_HOME% not found!" goto err @@ -1240,4 +1240,4 @@ REM Safe echo which does not mess with () in strings set "eout=%1" set eout=%eout:"=% echo !eout! -GOTO :eof \ No newline at end of file +GOTO :eof