Author: jleroux Date: Tue Mar 4 21:02:56 2014 New Revision: 1574203 URL: http://svn.apache.org/r1574203 Log: "Applied fix from trunk for revision: 1574201" ------------------------------------------------------------------------ r1574201 | jleroux | 2014-03-04 22:02:13 +0100 (mar. 04 mars 2014) | 1 ligne
Running OFBiz with start-batch, stopping it then or checking its status was missing, this completes these aspects. ------------------------------------------------------------------------ Modified: ofbiz/branches/release13.07/ (props changed) ofbiz/branches/release13.07/build.xml ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Config.java ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Start.java Propchange: ofbiz/branches/release13.07/ ------------------------------------------------------------------------------ Merged /ofbiz/trunk:r1574201 Modified: ofbiz/branches/release13.07/build.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/build.xml?rev=1574203&r1=1574202&r2=1574203&view=diff ============================================================================== --- ofbiz/branches/release13.07/build.xml (original) +++ ofbiz/branches/release13.07/build.xml Tue Mar 4 21:02:56 2014 @@ -423,6 +423,8 @@ under the License. <jvmarg value="${memory.initial.param}"/> <jvmarg value="${memory.max.param}"/> <jvmarg value="${memory.maxpermsize.param}"/> + <arg value="start-batch"/> + <arg value="-portoffset=${portoffset}"/> </java> </target> <target name="start-debug" @@ -435,6 +437,7 @@ under the License. <jvmarg value="-Djava.compiler=NONE"/> <jvmarg value="-Xdebug"/> <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"/> + <arg value="-portoffset=${portoffset}"/> </java> </target> <target name="start-pos" @@ -444,7 +447,7 @@ under the License. <jvmarg value="${memory.max.param}"/> <jvmarg value="${memory.maxpermsize.param}"/> <arg value="pos"/> - <arg value="-portoffset=${portoffset}"/> + <arg value="-portoffset=${portoffset}"/><!-- Not sure this makes sense and is useful at all --> </java> </target> <target name="start-both" @@ -461,12 +464,14 @@ under the License. description="Stop OFBiz"> <java jar="ofbiz.jar" fork="true"> <arg value="-shutdown"/> + <arg value="-portoffset=${portoffset}"/> </java> </target> <target name="status" description="Display status of OFBiz"> <java jar="ofbiz.jar" fork="true"> <arg value="-status"/> + <arg value="-portoffset=${portoffset}"/> </java> </target> Modified: ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Config.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Config.java?rev=1574203&r1=1574202&r2=1574203&view=diff ============================================================================== --- ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Config.java (original) +++ ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Config.java Tue Mar 4 21:02:56 2014 @@ -55,6 +55,10 @@ public class Config { public static Config getInstance(String[] args) throws IOException { String firstArg = args.length > 0 ? args[0] : ""; + // Needed when portoffset is used with these commands + if ("start-batch".equals(firstArg) || "stop".equals(firstArg)) { + firstArg = "start"; + } String configFileName = getConfigFileName(firstArg); Config result = new Config(); result.readConfig(configFileName, args); Modified: ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Start.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Start.java?rev=1574203&r1=1574202&r2=1574203&view=diff ============================================================================== --- ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Start.java (original) +++ ofbiz/branches/release13.07/framework/start/src/org/ofbiz/base/start/Start.java Tue Mar 4 21:02:56 2014 @@ -87,7 +87,9 @@ public final class Start { } else if (arg.equals("-shutdown")) { command = checkCommand(command, Command.SHUTDOWN); } else if (arg.startsWith("-")) { - command = checkCommand(command, Command.COMMAND); + if (!arg.contains("portoffset")) { + command = checkCommand(command, Command.COMMAND); + } loaderArgs.add(arg.substring(1)); } else { command = checkCommand(command, Command.COMMAND); @@ -189,6 +191,17 @@ public final class Start { // parse the startup arguments if (args.length > 1) { this.loaderArgs.addAll(Arrays.asList(args).subList(1, args.length)); + // Needed when portoffset is used with these commands + try { + if ("status".equals(args[0])) { + System.out.println("Current Status : " + instance.status()); + } else if ("stop".equals(args[0])) { + System.out.println("Shutting down server : " + instance.shutdown()); + } + } catch (Exception e) { + e.printStackTrace(); + System.exit(99); + } } if (!fullInit) { return;