You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by th...@apache.org on 2006/10/20 07:46:50 UTC

svn commit: r466002 - /webservices/axis2/branches/java/1_1/modules/tool/script/simpleaxis2server.bat

Author: thilina
Date: Thu Oct 19 22:46:49 2006
New Revision: 466002

URL: http://svn.apache.org/viewvc?view=rev&rev=466002
Log:
improving the simpleaxis2server.bat..
Thanx Asankha for the support..

Modified:
    webservices/axis2/branches/java/1_1/modules/tool/script/simpleaxis2server.bat

Modified: webservices/axis2/branches/java/1_1/modules/tool/script/simpleaxis2server.bat
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/tool/script/simpleaxis2server.bat?view=diff&rev=466002&r1=466001&r2=466002
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/tool/script/simpleaxis2server.bat (original)
+++ webservices/axis2/branches/java/1_1/modules/tool/script/simpleaxis2server.bat Thu Oct 19 22:46:49 2006
@@ -1,6 +1,21 @@
 @echo off
+
+REM  Copyright 2001,2004-2005 The Apache Software Foundation
+REM
+REM  Licensed under the Apache License, Version 2.0 (the "License");
+REM  you may not use this file except in compliance with the License.
+REM  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 Startup script for the Simple HTTP Server
+rem Startup script for the Simple Axis Server (with default parameters)
 rem
 rem Environment Variable Prequisites
 rem
@@ -10,52 +25,64 @@
 rem
 rem   JAVA_OPTS       (Optional) Java runtime options 
 rem ---------------------------------------------------------------------------
-set CURRENT_DIR=%cd%
 
-rem Make sure prerequisite environment variables are set
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+rem %~dp0 is expanded pathname of the current script under NT
+set DEFAULT_AXIS2_HOME=%~dp0..
+
+if "%AXIS2_HOME%"=="" set AXIS2_HOME=%DEFAULT_AXIS2_HOME%
+set DEFAULT_AXIS2_HOME=
+
+rem find AXIS2_HOME if it does not exist due to either an invalid value passed
+rem by the user or the %0 problem on Windows 9x
+
+if exist "%AXIS2_HOME%\conf\axis2.xml" goto checkJava
+
+:noAxis2Home
+echo AXIS2_HOME environment variable is set incorrectly or AXIS2 could not be located. 
+echo Please set the AXIS2_HOME variable appropriately
 goto end
-:gotJavaHome
+
+:checkJava
+set _JAVACMD=%JAVACMD%
+
+if "%JAVA_HOME%" == "" goto noJavaHome
 if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-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/JRE
-goto end
-:okJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
+if  "%AXIS2_CMD_LINE_ARGS%" == "" goto defaultParams
+
+goto runAxis2
 
-rem check the AXIS2_HOME environment variable
-if not "%AXIS2_HOME%" == "" goto gotHome
-set AXIS2_HOME=%CURRENT_DIR%
-if exist "%AXIS2_HOME%\bin\start.bat" goto okHome
-
-rem guess the home. Jump one directory up to check if that is the home
-cd ..
-set AXIS2_HOME=%cd%
-cd %CURRENT_DIR%
-
-:gotHome
-if EXIST "%AXIS2_HOME%\lib\axis2*.jar" goto okHome
-echo The AXIS2_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
+:defaultParams
+set AXIS2_CMD_LINE_ARGS=-repo "%AXIS2_HOME%\repository" -conf "%AXIS2_HOME%\conf\axis2.xml"
+goto runAxis2
+
+:noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=java.exe
+echo JAVA_HOME environment variable is set incorrectly or Java runtime could not be located.
+echo Please set the JAVA_HOME variable appropriately
 goto end
 
-:okHome
-rem set the classes
+:runAxis2
+rem set the classes by looping through the libs
 setlocal EnableDelayedExpansion
-rem loop through the libs and add them to the class path
 set AXIS2_CLASS_PATH=%AXIS2_HOME%
-FOR %%c in (%AXIS2_HOME%\lib\*.jar) DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;%%c
+FOR %%C in (%AXIS2_HOME%\lib\*.jar) DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;"%%~fC"
+set AXIS2_CLASS_PATH=%AXIS2_HOME%\conf;%AXIS2_CLASS_PATH%
 
-rem ----- Execute The Requested Command ---------------------------------------
-echo Using AXIS2_HOME:   %AXIS2_HOME%
-echo Using JAVA_HOME:    %JAVA_HOME%
-set _RUNJAVA="%JAVA_HOME%\bin\java"
+echo Using JAVA_HOME    %JAVA_HOME%
+echo Using AXIS2_HOME   %AXIS2_HOME%
+cd %AXIS2_HOME%
+"%_JAVACMD%" %JAVA_OPTS% -cp %AXIS2_CLASS_PATH% org.apache.axis2.transport.SimpleAxis2Server %AXIS2_CMD_LINE_ARGS%
+goto end
 
-%_RUNJAVA% %JAVA_OPTS% -cp %AXIS2_CLASS_PATH% org.apache.axis2.transport.SimpleAxis2Server  -repo $AXIS2_HOME\repository -conf $AXIS2_HOME\conf\axis2.xml %*
-endlocal
 :end
+set _JAVACMD=
+set AXIS2_CMD_LINE_ARGS=
+
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
 
+:mainEnd



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org