A patch from Francis ANDRE "unify admin port and key setting: single point of definition in start.properties" https://issues.apache.org/jira/browse/OFBIZ-4793

If someone wants to change the admin password or port, he would have to change currently many files (-- build.xml, various .bat and .sh --). In order to avoid this error-prone pratice, I suggest to centralize the definition of the admin kay and port at 2 single points: the framework/start/src/org/ofbiz/base/start/start.properties and the
framework/start/src/org/ofbiz/base/start/jetty.properties

jleroux: in config.java I also changed 
String adminPortStr = getProp(props, "ofbiz.admin.port", "0");
adminKey = getProp(props, "ofbiz.admin.key", "NA");
to
String adminPortStr = getProp(props, "ofbiz.admin.port", "10523");
adminKey = getProp(props, "ofbiz.admin.key", "so3du5kasd5dn");

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1324989 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2012-04-11 20:32:35 +00:00
parent f8c3982558
commit c79283dbfc
8 changed files with 17 additions and 45 deletions
-12
View File
@@ -24,8 +24,6 @@ under the License.
<import file="macros.xml"/>
<property name="site.dir" value="../site"/>
<property name="ofbiz.admin.port" value="10523"/>
<property name="ofbiz.admin.key" value="so3du5kasd5dn"/>
<property name="memory.initial.param" value="-Xms128M"/>
<property name="memory.max.param" value="-Xmx512M"/>
<property name="pos.memory.max.param" value="-Xmx512M"/>
@@ -386,8 +384,6 @@ under the License.
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${pos.memory.max.param}"/>
<jvmarg value="${memory.maxpermsize.param}"/>
<sysproperty key="ofbiz.admin.port" value="${ofbiz.admin.port}"/>
<sysproperty key="ofbiz.admin.key" value="${ofbiz.admin.key}"/>
</java>
</target>
<target name="start-batch"
@@ -396,8 +392,6 @@ under the License.
<jvmarg value="${memory.initial.param}"/>
<jvmarg value="${pos.memory.max.param}"/>
<jvmarg value="${memory.maxpermsize.param}"/>
<sysproperty key="ofbiz.admin.port" value="${ofbiz.admin.port}"/>
<sysproperty key="ofbiz.admin.key" value="${ofbiz.admin.key}"/>
</java>
</target>
<target name="start-debug" depends="build"
@@ -410,8 +404,6 @@ under the License.
<jvmarg value="-Djava.compiler=NONE"/>
<jvmarg value="-Xdebug"/>
<jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"/>
<sysproperty key="ofbiz.admin.port" value="${ofbiz.admin.port}"/>
<sysproperty key="ofbiz.admin.key" value="${ofbiz.admin.key}"/>
</java>
</target>
<target name="start-pos"
@@ -426,16 +418,12 @@ under the License.
<target name="stop"
description="Stop OFBiz">
<java jar="ofbiz.jar" fork="true">
<sysproperty key="ofbiz.admin.port" value="${ofbiz.admin.port}"/>
<sysproperty key="ofbiz.admin.key" value="${ofbiz.admin.key}"/>
<arg value="-shutdown"/>
</java>
</target>
<target name="status"
description="Display status of OFBiz">
<java jar="ofbiz.jar" fork="true">
<sysproperty key="ofbiz.admin.port" value="${ofbiz.admin.port}"/>
<sysproperty key="ofbiz.admin.key" value="${ofbiz.admin.key}"/>
<arg value="-status"/>
</java>
</target>
@@ -461,7 +461,7 @@ public class GenericEntity extends Observable implements Map<String, Object>, Lo
}
boolean isNullString = false;
if ("null".equals(value) || "[null-field]".equals(value)) {
if ("null".equals(value) || "[null-field]".equals(value)) { // keep [null-field] here but not sure it' used now
// count this as a null too, but only for numbers and stuff, not for Strings
isNullString = true;
}
@@ -1079,7 +1079,12 @@ public class GenericEntity extends Observable implements Map<String, Object>, Lo
element.setAttribute(name, value);
}
} else {
element.setAttribute(name, GenericEntity.NULL_FIELD.toString());
element.setAttribute(name, "null");
element.setAttribute("xsi:nil", "true");
// I tried to put the schema in the envelope header (in createAndSendSOAPResponse)
// resEnv.declareNamespace("http://www.w3.org/2001/XMLSchema-instance", null);
// But it gets prefixed and that does not work. So adding in each instance
element.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
}
}
@@ -28,9 +28,9 @@ java.tools.jar.required=true
#ofbiz.home=
# --- Set these for shutting down when running as background process
#ofbiz.admin.host=127.0.0.1
#ofbiz.admin.port=10523
#ofbiz.admin.key=so3du5kasd5dn
ofbiz.admin.host=127.0.0.1
ofbiz.admin.port=10523
ofbiz.admin.key=so3du5kasd5dn
# --- External Base configuration files (relative to ofbiz.home)
#ofbiz.base.config=framework/base/config
@@ -28,9 +28,9 @@
#ofbiz.home=
# --- Set these for shutting down when running as background process
#ofbiz.admin.host=127.0.0.1
#ofbiz.admin.port=10523
#ofbiz.admin.key=so3du5kasd5dn
ofbiz.admin.host=127.0.0.1
ofbiz.admin.port=10523
ofbiz.admin.key=so3du5kasd5dn
# --- External Base configuration files (relative to ofbiz.home)
#ofbiz.base.config=framework/base/config
+1 -6
View File
@@ -18,10 +18,6 @@
# under the License.
#####################################################################
# shutdown settings
ADMIN_PORT=10523
ADMIN_KEY=so3du5kasd5dn
# console log file
OFBIZ_LOG=runtime/logs/console.log
@@ -29,7 +25,6 @@ OFBIZ_LOG=runtime/logs/console.log
rm -f $OFBIZ_LOG
# VM args
ADMIN="-Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY"
#DEBUG="-Dsun.rmi.server.exceptionTrace=true"
#DEBUG="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"
#automatic IP address for linux
@@ -38,7 +33,7 @@ ADMIN="-Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY"
MEMIF="-Xms128M -Xmx512M -XX:MaxPermSize=512m"
#JMX="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=33333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
#MISC="-Duser.language=en"
VMARGS="$MEMIF $MISC $JMX $DEBUG $RMIIF $ADMIN"
VMARGS="$MEMIF $MISC $JMX $DEBUG $RMIIF"
# Worldpay Config
#VMARGS="-Xbootclasspath/p:applications/accounting/lib/cryptix.jar $VMARGS"
+1 -5
View File
@@ -28,9 +28,5 @@ else
JAVA=java
fi
# shutdown settings
ADMIN_PORT=10523
ADMIN_KEY=so3du5kasd5dn
$JAVA -Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY -jar ofbiz.jar -shutdown
$JAVA -jar ofbiz.jar -shutdown
+1 -6
View File
@@ -18,10 +18,6 @@
# under the License.
#####################################################################
# shutdown settings
ADMIN_PORT=10523
ADMIN_KEY=so3du5kasd5dn
# set the parent directory as OFBiz Home
OFBIZ_HOME="$( cd -P "$( dirname "$0" )" && pwd )"/..
@@ -32,7 +28,6 @@ OFBIZ_LOG=runtime/logs/console.log
rm -f $OFBIZ_LOG
# VM args
ADMIN="-Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY"
#DEBUG="-Dsun.rmi.server.exceptionTrace=true"
#DEBUG="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8091"
#automatic IP address for linux
@@ -41,7 +36,7 @@ ADMIN="-Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY"
MEMIF="-Xms128M -Xmx512M -XX:MaxPermSize=512m"
#JMX="-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=33333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
#MISC="-Duser.language=en"
VMARGS="$MEMIF $MISC $JMX $DEBUG $RMIIF $ADMIN"
VMARGS="$MEMIF $MISC $JMX $DEBUG $RMIIF"
# Worldpay Config
#VMARGS="-Xbootclasspath/p:applications/accounting/lib/cryptix.jar $VMARGS"
+1 -8
View File
@@ -17,10 +17,6 @@
# specific language governing permissions and limitations
# under the License.
#####################################################################
####
# ofbiz.admin.key and ofbiz.admin.port must match that which OFBIZ was started with
####
OFBIZ_HOME="$( cd -P "$( dirname "$0" )" && pwd )"/..
# location of java executable
@@ -30,9 +26,6 @@ else
JAVA=java
fi
# shutdown settings
ADMIN_PORT=10523
ADMIN_KEY=so3du5kasd5dn
(cd "$OFBIZ_HOME" && $JAVA -Dofbiz.admin.port=$ADMIN_PORT -Dofbiz.admin.key=$ADMIN_KEY -jar ofbiz.jar -shutdown)
(cd "$OFBIZ_HOME" && $JAVA -jar ofbiz.jar -shutdown)