Changeset 35661 for main/trunk/gli
- Timestamp:
- 2021-10-21T18:58:59+13:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/util/GS3ServerThread.java
r35637 r35661 63 63 { 64 64 ///System.err.println("**** GS3 server : " + _ant_command); 65 66 // NOTE on the use of 'noclasspath'67 //68 // The inclusion of the '-noclasspath' flag is to avoid the ant bash/bat script finding the ant.jar in69 // Greenstone's web/WEB-INF area which ends up on CLASSPATH as a consequence of gs3-setup being run,70 // which -- because that ant.jar file was produced by an older JDK -- then messes up our build.xml test for71 // the version of java being using. The test ends up being told the java version is 1.7, even if we are72 // running a JDK8 or above!73 //74 // In more detail ...75 // The ant.jar file we have in web/WEB-INF is from an ant v1.8.2 install make with a JDK7, and has the76 // undesirable side affect of changing the Java properties for 'ant.version' and 'ant.java.version'. In the77 // case of the latter (ant.java.version = 1.7), this then means that when -- in our top-level build.xml78 // file -- we test to make sure we are running a JDK8 or better, we get the answer 1.7 and so fail-out at that79 // point (even though our JDK is newer than this).80 //81 // We get the problem in gli because gs3-setup.sh is run before the Java code is launched, which then goes82 // on to run 'ant'. By this point CLASSPATH has been set, containing ant.jar. You don't necessarily see the83 // problem running things like 'ant start' and 'ant stop' on the command line, as 'ant' is already running84 // before build.xml triggers the sourcing of gs3-setup.bash.85 86 65 87 66 SafeProcess p = null; … … 93 72 // The path in quotes, and the entire sequence of commands in quotes as well 94 73 // E.g. the following works in a Runtime.exec() call: 95 // cmd /C "cd "C:\path\to\greenstone3" && ant -noclasspathstop"74 // cmd /C "cd "C:\path\to\greenstone3" && ant stop" 96 75 // and it preserves any spaces in the path to GSDL3SRCHOME (_gsdl3_src_path). 97 p = new SafeProcess("cmd /C \"cd \"" + _gsdl3_src_path + File.separator + "\" && ant -noclasspath" + _ant_command + "\"");76 p = new SafeProcess("cmd /C \"cd \"" + _gsdl3_src_path + File.separator + "\" && ant " + _ant_command + "\""); 98 77 } 99 78 else { … … 101 80 _ant_command = "restart"; 102 81 } 103 p = new SafeProcess(new String[]{"/bin/bash", "-c", "ant -noclasspath" + _ant_command + " -f \"" + _gsdl3_src_path + File.separator + "build.xml\""});82 p = new SafeProcess(new String[]{"/bin/bash", "-c", "ant " + _ant_command + " -f \"" + _gsdl3_src_path + File.separator + "build.xml\""}); 104 83 } 105 84 … … 142 121 SafeProcess p = null; 143 122 if (Utility.isWindows()) { 144 // cmd /C "cd "C:\path\to\greenstone3" && ant -noclasspathstop"145 p = new SafeProcess("cmd /C \"cd \"" + Configuration.gsdl3_src_path + File.separator + "\" && ant -noclasspathstop\"");123 // cmd /C "cd "C:\path\to\greenstone3" && ant stop" 124 p = new SafeProcess("cmd /C \"cd \"" + Configuration.gsdl3_src_path + File.separator + "\" && ant stop\""); 146 125 } else { 147 p = new SafeProcess(new String[]{"/bin/bash", "-c", "ant -noclasspathstop -f \"" + Configuration.gsdl3_src_path + File.separator + "build.xml\""});126 p = new SafeProcess(new String[]{"/bin/bash", "-c", "ant stop -f \"" + Configuration.gsdl3_src_path + File.separator + "build.xml\""}); 148 127 } 149 128 … … 171 150 172 151 public static boolean isServerRunning() { 173 String antCmd = "ant -noclasspathverbose-check-tomcat-running";152 String antCmd = "ant verbose-check-tomcat-running"; 174 153 175 154 SafeProcess p = null;
Note:
See TracChangeset
for help on using the changeset viewer.