You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by an...@apache.org on 2012/01/19 13:07:36 UTC

svn commit: r1233304 - in /openejb/trunk/openejb: assembly/openejb-standalone/src/main/resources/ tomee/apache-tomee/src/main/assembly/ tomee/apache-tomee/src/main/resources/

Author: andygumbrecht
Date: Thu Jan 19 12:07:35 2012
New Revision: 1233304

URL: http://svn.apache.org/viewvc?rev=1233304&view=rev
Log:
TomEE Windows service files.
Daemon 1.0.8

Added:
    openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.amd64.exe   (with props)
    openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.ia64.exe   (with props)
    openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.x86.exe   (with props)
    openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.bat
    openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat
    openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.readme.txt
    openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat
Modified:
    openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.amd64.exe
    openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.ia64.exe
    openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.x86.exe
    openejb/trunk/openejb/tomee/apache-tomee/src/main/assembly/tomee-plus.xml

Modified: openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.amd64.exe
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.amd64.exe?rev=1233304&r1=1233303&r2=1233304&view=diff
==============================================================================
Binary files - no diff available.

Modified: openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.ia64.exe
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.ia64.exe?rev=1233304&r1=1233303&r2=1233304&view=diff
==============================================================================
Binary files - no diff available.

Modified: openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.x86.exe
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/assembly/openejb-standalone/src/main/resources/OpenEJB.x86.exe?rev=1233304&r1=1233303&r2=1233304&view=diff
==============================================================================
Binary files - no diff available.

Modified: openejb/trunk/openejb/tomee/apache-tomee/src/main/assembly/tomee-plus.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/apache-tomee/src/main/assembly/tomee-plus.xml?rev=1233304&r1=1233303&r2=1233304&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/apache-tomee/src/main/assembly/tomee-plus.xml (original)
+++ openejb/trunk/openejb/tomee/apache-tomee/src/main/assembly/tomee-plus.xml Thu Jan 19 12:07:35 2012
@@ -62,6 +62,14 @@
         <include>*</include>
       </includes>
     </fileSet>
+	<fileSet>
+      <directory>${basedir}/src/main/resources/</directory>
+      <outputDirectory>/apache-tomee-plus-${project.version}/bin</outputDirectory>
+      <includes>
+        <include>service.*</include>
+        <include>TomEE.*</include>
+      </includes>
+    </fileSet>
   </fileSets>
 </assembly>
 

Added: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.amd64.exe
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.amd64.exe?rev=1233304&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.amd64.exe
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.ia64.exe
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.ia64.exe?rev=1233304&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.ia64.exe
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.x86.exe
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.x86.exe?rev=1233304&view=auto
==============================================================================
Binary file - no diff available.

Propchange: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/TomEE.x86.exe
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.bat
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.bat?rev=1233304&view=auto
==============================================================================
--- openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.bat (added)
+++ openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.bat Thu Jan 19 12:07:35 2012
@@ -0,0 +1,216 @@
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements.  See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License.  You may obtain a copy of the License at
+rem
+rem     http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+@IF NOT "%ECHO%" == ""  ECHO %ECHO%
+@IF "%OS%" == "Windows_NT" setlocal
+
+IF "%OS%" == "Windows_NT" (
+  SET "DIRNAME=%~dp0%"
+) ELSE (
+  SET DIRNAME=.\
+)
+
+pushd %DIRNAME%
+
+rem ---------------------------------------------------------------------------
+rem NT Service Install/Uninstall script
+rem
+rem Options
+rem install                Install the service using TomEE as service name.
+rem                        Service is installed using default settings.
+rem remove                 Remove the service from the System.
+rem
+rem name        (optional) If the second argument is present it is considered
+rem                        to be new service name
+rem
+rem $Id: service.bat 1000718 2010-09-24 06:00:00Z mturk $
+rem ---------------------------------------------------------------------------
+
+set JAVA_HOME="C:/JDK"
+SET proc=undefined
+
+IF /i %PROCESSOR_ARCHITECTURE% EQU X86 SET proc="%~dp0TomEE.%PROCESSOR_ARCHITECTURE%.exe"
+IF /i %PROCESSOR_ARCHITECTURE% EQU AMD64 SET proc="%~dp0TomEE.%PROCESSOR_ARCHITECTURE%.exe"
+IF /i %PROCESSOR_ARCHITECTURE% EQU IA64 SET proc="%~dp0TomEE.%PROCESSOR_ARCHITECTURE%.exe"
+
+IF /i %proc% EQU undefined (
+	ECHO Failed to determine OS architecture
+	GOTO end
+)
+
+set "SELF=%~dp0%service.bat"
+rem Guess CATALINA_HOME if not defined
+set "CURRENT_DIR=%cd%"
+if not "%CATALINA_HOME%" == "" goto gotHome
+set "CATALINA_HOME=%cd%"
+if exist "%CATALINA_HOME%\bin\service.bat" goto okHome
+rem CD to the upper dir
+cd ..
+set "CATALINA_HOME=%cd%"
+:gotHome
+if exist "%CATALINA_HOME%\bin\service.bat" goto okHome
+echo The service exe was not found...
+echo The CATALINA_HOME environment variable is not defined correctly.
+echo This environment variable is needed to run this program
+goto end
+:okHome
+rem Make sure prerequisite environment variables are set
+if not "%JAVA_HOME%" == "" goto gotJdkHome
+if not "%JRE_HOME%" == "" goto gotJreHome
+echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
+echo Service will try to guess them from the registry.
+goto okJavaHome
+:gotJreHome
+if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome
+if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome
+goto okJavaHome
+:gotJdkHome
+if not exist "%JAVA_HOME%\jre\bin\java.exe" goto noJavaHome
+if not exist "%JAVA_HOME%\jre\bin\javaw.exe" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
+if not "%JRE_HOME%" == "" goto okJavaHome
+set "JRE_HOME=%JAVA_HOME%\jre"
+goto okJavaHome
+:noJavaHome
+echo The JAVA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+echo NB: JAVA_HOME should point to a JDK not a JRE
+goto end
+:okJavaHome
+if not "%CATALINA_BASE%" == "" goto gotBase
+set "CATALINA_BASE=%CATALINA_HOME%"
+:gotBase
+
+set "EXECUTABLE=%proc%"
+
+rem Set default Service name
+set SERVICE_NAME=TomEE
+set PR_DISPLAYNAME=Apache TomEE
+
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_CMD=%1
+shift
+if "x%1x" == "xx" goto checkServiceCmd
+:checkUser
+if "x%1x" == "x/userx" goto runAsUser
+if "x%1x" == "x--userx" goto runAsUser
+set SERVICE_NAME=%1
+set PR_DISPLAYNAME=TomEE %1
+shift
+if "x%1x" == "xx" goto checkServiceCmd
+goto checkUser
+:runAsUser
+shift
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_USER=%1
+shift
+runas /env /savecred /user:%SERVICE_USER% "%COMSPEC% /K \"%SELF%\" %SERVICE_CMD% %SERVICE_NAME%"
+goto end
+:checkServiceCmd
+if /i %SERVICE_CMD% == install goto doInstall
+if /i %SERVICE_CMD% == remove goto doRemove
+if /i %SERVICE_CMD% == uninstall goto doRemove
+echo Unknown parameter "%1"
+:displayUsage
+echo.
+echo Usage: service.bat install/remove [service_name] [/user username]
+goto end
+
+:doRemove
+rem Remove the service
+%EXECUTABLE% //DS//%SERVICE_NAME%
+if not errorlevel 1 goto removed
+echo Failed removing '%SERVICE_NAME%' service
+goto end
+:removed
+echo The service '%SERVICE_NAME%' has been removed
+goto end
+
+:doInstall
+rem Install the service
+echo Installing the service '%SERVICE_NAME%' ...
+echo Using CATALINA_HOME:    "%CATALINA_HOME%"
+echo Using CATALINA_BASE:    "%CATALINA_BASE%"
+echo Using JAVA_HOME:        "%JAVA_HOME%"
+echo Using JRE_HOME:         "%JRE_HOME%"
+
+rem Use the environment variables as an example
+rem Each command line option is prefixed with PR_
+
+set "PR_DESCRIPTION=Apache TomEE - http://http://openejb.apache.org/"
+set PR_INSTALL=%EXECUTABLE%
+set "PR_LOGPATH=%CATALINA_BASE%\logs"
+set "PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\tomcat-juli.jar"
+rem Set the server jvm from JAVA_HOME
+set "PR_JVM=%JRE_HOME%\bin\server\jvm.dll"
+if exist "%PR_JVM%" goto foundJvm
+rem Set the client jvm from JAVA_HOME
+set "PR_JVM=%JRE_HOME%\bin\client\jvm.dll"
+if exist "%PR_JVM%" goto foundJvm
+set PR_JVM=auto
+:foundJvm
+echo Using JVM:              "%PR_JVM%"
+
+echo %EXECUTABLE% //IS//%SERVICE_NAME%
+
+%EXECUTABLE% //IS//%SERVICE_NAME%  ^
+	--DisplayName="%SERVICE_NAME%" ^
+	--StartClass org.apache.catalina.startup.Bootstrap ^
+	--StopClass org.apache.catalina.startup.Bootstrap ^
+	--StartParams start ^
+	--StopParams stop
+
+	if not errorlevel 1 goto installed
+echo Failed installing '%SERVICE_NAME%' service
+goto end
+
+:installed
+rem Clear the environment variables. They are not needed any more.
+set PR_DISPLAYNAME=
+set PR_DESCRIPTION=
+set PR_INSTALL=
+set PR_LOGPATH=
+set PR_CLASSPATH=
+set PR_JVM=
+
+rem Set extra parameters
+%EXECUTABLE% //US//%SERVICE_NAME% ^
+	++JvmOptions=-Dcatalina.base="%CATALINA_BASE%" ^
+	++JvmOptions=-Dcatalina.home="%CATALINA_HOME%" ^
+	++JvmOptions=-Djava.endorsed.dirs="%CATALINA_HOME%\endorsed" ^
+	--StartMode jvm ^
+	--StopMode jvm
+
+rem More extra parameters
+set "PR_LOGPATH=%CATALINA_BASE%\logs"
+set PR_STDOUTPUT=auto
+set PR_STDERROR=auto
+
+%EXECUTABLE% //US//%SERVICE_NAME% ^
+	++JvmOptions=-Djava.library.path="%CATALINA_BASE%\bin" ^
+	++JvmOptions=-Djava.io.tmpdir="%CATALINA_BASE%\temp" ^
+	++JvmOptions=-Djava.util.logging.manager="org.apache.juli.ClassLoaderLogManager" ^
+	++JvmOptions=-Djava.util.logging.config.file="%CATALINA_BASE%\conf\logging.properties" ^
+	++JvmOptions=-Djava.awt.headless=true ^
+	++JvmOptions=-XX:+UseParallelGC ^
+	++JvmOptions=-XX:+AggressiveHeap ^
+	++JvmOptions=-XX:MaxPermSize=256M ^
+	++JvmOptions=-Xss2048k
+	
+echo The service '%SERVICE_NAME%' has been installed.
+
+:end
+cd "%CURRENT_DIR%"

Added: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat?rev=1233304&view=auto
==============================================================================
--- openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat (added)
+++ openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat Thu Jan 19 12:07:35 2012
@@ -0,0 +1,33 @@
+@echo off
+cls
+REM================================================
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements.  See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License.  You may obtain a copy of the License at
+REM
+REM    http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+REM _______________________________________________
+REM $Rev$
+REM================================================
+
+@if not "%ECHO%" == ""  echo %ECHO%
+@if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+  set "DIRNAME=%~dp0%"
+) else (
+  set DIRNAME=.\
+)
+
+pushd %DIRNAME%
+
+service install
\ No newline at end of file

Added: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.readme.txt
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.readme.txt?rev=1233304&view=auto
==============================================================================
--- openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.readme.txt (added)
+++ openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.readme.txt Thu Jan 19 12:07:35 2012
@@ -0,0 +1 @@
+Windows NT Service
==================

The two batch files for creating and removing TomEE as a Windows Service are basically
self explanatory. Both scripts must be run using an account that has rights to install
or de-install a service. This is usually an administrator account.

service.install.as.admin.bat
service.remove.as.admin.bat

NOTE: Both scripts actually call the service.bat file, if you modify this batch file then ensure that there are no hidden
characters after the '^' continuation symbol (such as tab or space). But always ensure
there is a space before (and not a tab). The service installer will drop further options
and simply warn that '++JvmOptions' is unknown, leading to unexpected results.

++JvmOptions=-Dcatalina.base="%CATALINA_BASE%" ^
++JvmOptions=-Xms128M ^[tab or space] <-- Will break here, no further options will be appended
++JvmOptions=-Xmx512M ^
++JvmOptions=-XX:MaxPermSize=256M <-- Last line has no continuation symbol
\ No newline at end of file

Added: openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat?rev=1233304&view=auto
==============================================================================
--- openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat (added)
+++ openejb/trunk/openejb/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat Thu Jan 19 12:07:35 2012
@@ -0,0 +1,33 @@
+@echo off
+cls
+REM================================================
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements.  See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License.  You may obtain a copy of the License at
+REM
+REM    http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+REM _______________________________________________
+REM $Rev$
+REM================================================
+
+@if not "%ECHO%" == ""  echo %ECHO%
+@if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+  set "DIRNAME=%~dp0%"
+) else (
+  set DIRNAME=.\
+)
+
+pushd %DIRNAME%
+
+service remove
\ No newline at end of file