Author: jleroux
Date: Fri Mar 14 22:20:34 2014 New Revision: 1577744 URL: http://svn.apache.org/r1577744 Log: Fixes a bug introduced with r1574404 (forgot that shutdown and status historicaly have a prefixing dash), thanks to Youseek Khaye who spotted it and sent me a mail (the stop target was no longer working). I tested them only with a portoffset, my bad. While working on this I spotted another error introduced earlier with r1533839. Now, status and stop work again as before. Modified: ofbiz/trunk/build.xml ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java Modified: ofbiz/trunk/build.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/build.xml?rev=1577744&r1=1577743&r2=1577744&view=diff ============================================================================== --- ofbiz/trunk/build.xml (original) +++ ofbiz/trunk/build.xml Fri Mar 14 22:20:34 2014 @@ -426,7 +426,7 @@ under the License. <jvmarg value="${memory.initial.param}"/> <jvmarg value="${memory.max.param}"/> <jvmarg value="${memory.maxpermsize.param}"/> - <arg value="start-batch"/> + <arg value="start-batch"/> <arg value="-portoffset=${portoffset}"/> </java> </target> Modified: ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java?rev=1577744&r1=1577743&r2=1577744&view=diff ============================================================================== --- ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java (original) +++ ofbiz/trunk/framework/start/src/org/ofbiz/base/start/Config.java Fri Mar 14 22:20:34 2014 @@ -40,10 +40,6 @@ public class Config { if (command == null || command.trim().length() == 0) { command = "start"; } - // strip off the leading dash - if (command.startsWith("-")) { - command = command.substring(1); - } return "org/ofbiz/base/start/" + command + ".properties"; } @@ -53,8 +49,8 @@ public class Config { if ("start-batch".equalsIgnoreCase(firstArg) || "start-debug".equalsIgnoreCase(firstArg) || "stop".equalsIgnoreCase(firstArg) - || "shutdown".equalsIgnoreCase(firstArg) // shutdown & status hack (was pre-existing to portoffset introduction, also useful with it) - || "status".equalsIgnoreCase(firstArg)) { + || "-shutdown".equalsIgnoreCase(firstArg) // shutdown & status hack (was pre-existing to portoffset introduction, also useful with it) + || "-status".equalsIgnoreCase(firstArg)) { firstArg = "start"; } String configFileName = getConfigFileName(firstArg); @@ -356,14 +352,15 @@ public class Config { adminPort = Integer.parseInt(adminPortStr); if (args.length > 0) { for (String arg : args) { - if (arg.toLowerCase().contains("portoffset=")) { + if (arg.toLowerCase().contains("portoffset=") && !arg.toLowerCase().contains("${portoffset}")) { adminPort = adminPort != 0 ? adminPort : 10523; // This is necessary because the ASF machines don't allow ports 1 to 3, see INFRA-6790 adminPort += Integer.parseInt(arg.split("=")[1]); } } } } catch (Exception e) { - adminPort = 0; + System.out.println("Error while parsing admin port number (so default to 10523) = " + e); + adminPort = 10523; } // set the Derby system home |
Free forum by Nabble | Edit this page |