Skip to content

Apache Lucene open-source search software

SOLR-6120: Print a helpful error message from zkcli.bat when war is not extracted.

Shawn Heisey61ad099fe988
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index a59d61ed227..6392ffef973 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -209,6 +209,10 @@ Other Changes
* SOLR-6228: Fixed bug in TestReplicationHandler.doTestIndexAndConfigReplication. (shalin)
+* SOLR-6120: On Windows, when the war is not extracted, the zkcli.bat script
+ will print a helpful message indicating that the war must be unzipped instead
+ of a java error about a missing class.
+
================== 4.9.0 ==================
Versions of Major Components
diff --git a/solr/example/scripts/cloud-scripts/zkcli.bat b/solr/example/scripts/cloud-scripts/zkcli.bat
index bbf6d603219..b7aa695b482 100644
--- a/solr/example/scripts/cloud-scripts/zkcli.bat
+++ b/solr/example/scripts/cloud-scripts/zkcli.bat
@@ -1,3 +1,4 @@
+@echo off
REM You can override pass the following parameters to this script:
REM
@@ -8,4 +9,13 @@ REM Find location of this script
set SDIR=%~dp0
if "%SDIR:~-1%"=="\" set SDIR=%SDIR:~0,-1%
+IF exist %SDIR%\..\..\solr-webapp\webapp\nul (
+ echo %SDIR%\....\..\solr-webapp\webapp exists
+) ELSE (
+ echo -------------------
+ echo Unzip example\webapps\solr.war to example\solr-webapp\. to use this script.
+ echo Starting the Solr example via start.jar will also do this extraction.
+ echo -------------------
+)
+
"%JVM%" -Dlog4j.configuration="file:%SDIR%\log4j.properties" -classpath "%SDIR%\..\..\solr-webapp\webapp\WEB-INF\lib\*;%SDIR%\..\..\lib\ext\*" org.apache.solr.cloud.ZkCLI %*