. appserver.properties was missing in last commit
. 1st changes for a remote deployment tool . better README file git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@647299 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
#####################################################################
|
||||
# Copyright 2001-2006 The Apache Software Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
# use this file except in compliance with the License. You may obtain a copy of
|
||||
# the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#####################################################################
|
||||
|
||||
####
|
||||
# OFBiz Setup properties File
|
||||
####
|
||||
|
||||
######## Default WASCE/Geronimo Settings. Refer to the Guidelines in the OFBiz documentation : http://docs.ofbiz.org/x/Ah ########
|
||||
### Path to geronimo home (in other words, application server location).
|
||||
# You may also use a GERONIMO_HOME env var, in such case let commented out here
|
||||
#Linux
|
||||
#geronimoHome=/home/jacques/IBM/WebSphere/AppServerCommunityEdition
|
||||
#geronimoHome=/home/jacques/Apache Software Foundation/geronimo-tomcat6-jee5-2.0.3
|
||||
# Windows *** Note that under Windows you must use / here in place of \ (or put \\) ***
|
||||
#geronimoHome=C:/Program Files/IBM/WebSphere/AppServerCommunityEdition
|
||||
#geronimoHome=C:/Program Files/Apache Software Foundation/geronimo-tomcat6-jee5-2.0.3
|
||||
|
||||
### user login
|
||||
user=system
|
||||
# password
|
||||
password=manager
|
||||
|
||||
### Server is offline or not (should be ofline the 1st time you deploy since you need to copy after lines from META-INF/REAME)
|
||||
offline=true
|
||||
|
||||
### Pause in deployment script ?
|
||||
pauseInGeronimoScript=false
|
||||
|
||||
### host
|
||||
#host=192.168.2.7
|
||||
|
||||
### port
|
||||
#port=1099
|
||||
|
||||
### The number (instancesNumber) given here is in origin 0. Hence 0 means one instance.
|
||||
# In other word you give the n-1 number of instances (n being the number of instances).
|
||||
# For instance 2 means 3 instances deployed. # This to allow the default instance which is not numbered
|
||||
instancesNumber=0
|
||||
@@ -121,21 +121,23 @@ public class GenerateContainer implements Container {
|
||||
|
||||
String user = UtilProperties.getPropertyValue("appserver", "user", "system");
|
||||
String password = UtilProperties.getPropertyValue("appserver", "password", "manager");
|
||||
boolean offline = UtilProperties.propertyValueEqualsIgnoreCase("appserver", "offline", "true");
|
||||
boolean pauseInGeronimoScript = UtilProperties.propertyValueEqualsIgnoreCase("appserver", "pauseInGeronimoScript", "true");
|
||||
int instancesNumber = (int) UtilProperties.getPropertyNumber("appserver", "instancesNumber");
|
||||
boolean offline = UtilProperties.propertyValueEqualsIgnoreCase("appserver", "offline", "true");
|
||||
String host = UtilProperties.getPropertyValue("appserver", "host", "");
|
||||
String port = UtilProperties.getPropertyValue("appserver", "port", "");
|
||||
boolean pauseInGeronimoScript = UtilProperties.propertyValueEqualsIgnoreCase("appserver", "pauseInGeronimoScript", "true");
|
||||
String instanceNumber = "";
|
||||
|
||||
if (isGeronimo) {
|
||||
if (geronimoHome == null) {
|
||||
geronimoHome = System.getenv("GERONIMO_HOME");
|
||||
if (geronimoHome == null) {
|
||||
Debug.logFatal("'GERONIMO_HOME' was not found in your environment. Please set the location of Geronimo into a GERONIMO_HOME env var or pass it as geronimoHome property in setup.properties file.", module);
|
||||
Debug.logFatal("'GERONIMO_HOME' was not found in your environment. Please set the location of Geronimo into a GERONIMO_HOME env var or as a geronimoHome property in setup.properties file.", module);
|
||||
throw new ContainerException("Error in Geronimo deployment, please check the log");
|
||||
}
|
||||
File geronimoHomeDir = new File (geronimoHome);
|
||||
if (! (geronimoHomeDir.isDirectory())) {
|
||||
Debug.logFatal(geronimoHome + " does not exist or is not a directoy. Please set the location of Geronimo into a GERONIMO_HOME env var or pass it as geronimoHome property in setup.properties file.", module);
|
||||
Debug.logFatal(geronimoHome + " does not exist or is not a directoy. Please set the location of Geronimo into a GERONIMO_HOME env var or as a geronimoHome property in setup.properties file.", module);
|
||||
throw new ContainerException("Error in Geronimo deployment, please check the log");
|
||||
}
|
||||
}
|
||||
@@ -227,19 +229,26 @@ public class GenerateContainer implements Container {
|
||||
File workingDir = new File(geronimoBin);
|
||||
ProcessBuilder pb = null;
|
||||
String command = null;
|
||||
String commandCommonPart = null;
|
||||
String commandCommonHostPart = "";
|
||||
if (UtilValidate.isNotEmpty(host)) {
|
||||
commandCommonHostPart = " --host" + host + (UtilValidate.isNotEmpty(port) ? port : "");
|
||||
}
|
||||
|
||||
if ("\\".equals(separator)) { //Windows
|
||||
commandCommonPart = "deploy --user " + user + " --password " + password + commandCommonHostPart;
|
||||
if (offline) {
|
||||
command = "deploy --user " + user + " --password " + password + " --offline undeploy " + ofbizName;
|
||||
command = commandCommonPart + " --offline undeploy " + ofbizName;
|
||||
} else {
|
||||
command = "deploy --user " + user + " --password " + password + " undeploy " + ofbizName;
|
||||
command = commandCommonPart + " undeploy " + ofbizName;
|
||||
}
|
||||
pb = new ProcessBuilder("cmd.exe", "/c", command);
|
||||
} else { // Linux
|
||||
commandCommonPart = workingDir + "/deploy.sh --user " + user + " --password " + password + commandCommonHostPart;
|
||||
if (offline) {
|
||||
command = workingDir + "/deploy.sh --user " + user + " --password " + password + " --offline undeploy " + ofbizName;
|
||||
command = commandCommonPart + " --offline undeploy " + ofbizName;
|
||||
} else {
|
||||
command = workingDir + "/deploy.sh --user " + user + " --password " + password + " undeploy " + ofbizName;
|
||||
command = commandCommonPart + " undeploy " + ofbizName;
|
||||
}
|
||||
pb = new ProcessBuilder("sh", "-c", command);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ import org.ofbiz.base.util.UtilURL;
|
||||
import org.ofbiz.base.util.template.FreeMarkerWorker;
|
||||
|
||||
/**
|
||||
* GenerateGeronimoRepository - Generate needed 3d parties jars (only? rather all jars for now, see commented lines below) in Geronimo (or WASCE) repository
|
||||
* GenerateGeronimoRepository - Generate needed jars in Geronimo (or WASCE) repository
|
||||
*
|
||||
*/
|
||||
public class GenerateGeronimoDeployment {
|
||||
|
||||
@@ -17,16 +17,25 @@
|
||||
under the License.
|
||||
-->
|
||||
|
||||
Websphere Application Server Community Edition (WASCE) 2
|
||||
or Geronimo 2.0.3 Setup - 2008-04-08 - Jacques Le Roux
|
||||
|
||||
Websphere Application Server Community Edition (WASCE) 2 or Geronimo 2.0.3 Setup - 2008-04-08 - Jacques Le Roux
|
||||
Refer to the Guidelines in the OFBiz documentation : http://docs.ofbiz.org/x/Ah
|
||||
To use OFBiz with WASCE 2 or Geronimo 2.0.3 follow the following steps (all steps assume WASCE 2 or Geronimo 2.0.3 is already installed and working)
|
||||
|
||||
=======================================================================================================================================================
|
||||
If you use WASCE, copy the 2 lines below in the setJavaOpts section (Windows) or somewhere in the setEnv script you will find in GERONIMO_HOME/bin
|
||||
If you use Geronimo, simply put these 2 lines at the top of the setArgs section (Windows) or somewhere in the Geronimo script.
|
||||
In function of your OS, copy in the geronimo script (.sh or .bat), the 2 lines below in (at the top)
|
||||
of the doneSetArgs section (Windows)
|
||||
or the <<elif [ "$1" = "run" ]>> block (Linux)
|
||||
|
||||
For the ofbiz.home value:
|
||||
On Windows dont' worry about the /or \ in , they work both.
|
||||
On Linux depending on your distribution you might need to put inside quotes around the ofbizHome value, then don't forget to escape them
|
||||
For instance on Ubuntu 6.06 LTS inside quotes are needed, but don't put them for Suze 10...
|
||||
|
||||
Note :
|
||||
If you prefer on WASCE you may use the setven scvript to set your env value. Notably if you want to separate things and have more var to set
|
||||
Then copy the 2 lines below in the setJavaOpts section (Windows) or somewhere in the setEnv script you will find in GERONIMO_HOME/bin (Linux)
|
||||
This script does not exist in Geronimo but is anticipated and taken into account.
|
||||
If you need it, you may concatenate pre-existing JAVA_OPTS, same for CLASSPATH. But it's not needed for OFBiz alone.
|
||||
On Windows dont' worry about the /or \ in ofbiz.home, they work both.
|
||||
=======================================================================================================================================================
|
||||
|
||||
<#assign classpath = ""/>
|
||||
@@ -47,31 +56,21 @@ Add this 2 lines after the
|
||||
line
|
||||
JAVA_OPTS="-Dofbiz.home="${ofbizHome}" -Xms256M -Xmx512M -XX:MaxPermSize=128M -Duser.language=en"
|
||||
CLASSPATH="${classpath}"
|
||||
Don't forget to escape the inside quotes in ${ofbizHome}.
|
||||
|
||||
|
||||
=======================================================================================================================================================
|
||||
Change also this line of the geronimo script in the doneSetArgs section (Windows) or somewhere in the geronimo script
|
||||
Change also this line of the geronimo script in the doneSetArgs section (Windows) or in the <<elif [ "$1" = "run" ]>> block (Linux)
|
||||
=======================================================================================================================================================
|
||||
Windows
|
||||
-------
|
||||
%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %_LONG_OPT% %CMD_LINE_ARGS%
|
||||
to
|
||||
%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -cp .;%_JARFILE%;%CLASSPATH% %_LONG_OPT% %CMD_LINE_ARGS% %MAINCLASS%
|
||||
Replace the line
|
||||
%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -jar %_JARFILE% %_LONG_OPT% %CMD_LINE_ARGS%
|
||||
by
|
||||
%_EXECJAVA% %JAVA_OPTS% %GERONIMO_OPTS% %JAVA_AGENT_OPTS% -Djava.ext.dirs="%GERONIMO_BASE%\lib\ext;%JRE_HOME%\lib\ext" -Djava.endorsed.dirs="%GERONIMO_BASE%\lib\endorsed;%JRE_HOME%\lib\endorsed" -Dorg.apache.geronimo.base.dir="%GERONIMO_BASE%" -Djava.io.tmpdir="%GERONIMO_TMPDIR%" -cp .;%_JARFILE%;%CLASSPATH% %_LONG_OPT% %CMD_LINE_ARGS% %MAINCLASS%
|
||||
|
||||
Linux
|
||||
-----
|
||||
In the <<elif [ "$1" = "run" ]>> block
|
||||
Replace the line
|
||||
-jar "$GERONIMO_HOME"/bin/server.jar $LONG_OPT "$@"
|
||||
by
|
||||
-classpath ".":"$GERONIMO_HOME"/bin/server.jar:"$CLASSPATH" org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@"
|
||||
|
||||
=======================================================================================================================================================
|
||||
Windows only
|
||||
------------
|
||||
If you want to use OFBiz multi-instances in Geronimo or WASCE using you might put "exit" as last line in the deploy script.
|
||||
Else, of course you may also type exit by hand....
|
||||
|
||||
Alternatively you may not put exit at the end of the deploy script,
|
||||
choose to not have pause in script and type "exit" yourself in the command windows (actually I found later that it's an easier way)
|
||||
=======================================================================================================================================================
|
||||
-classpath ".":"$GERONIMO_HOME"/bin/server.jar:"$CLASSPATH" org.apache.geronimo.cli.daemon.DaemonCLI $LONG_OPT "$@"
|
||||
Reference in New Issue
Block a user