You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by in...@apache.org on 2008/01/24 09:51:22 UTC

svn commit: r614821 - in /webservices/synapse/branches/1.1.1: modules/samples/src/main/scripts/axis2server.bat repository/conf/sample-server-wrapper.conf repository/conf/wrapper.conf src/main/bin/synapse.bat

Author: indika
Date: Thu Jan 24 00:51:19 2008
New Revision: 614821

URL: http://svn.apache.org/viewvc?rev=614821&view=rev
Log:
enable to run sample axis2server using java service wrapper

Added:
    webservices/synapse/branches/1.1.1/repository/conf/sample-server-wrapper.conf
Modified:
    webservices/synapse/branches/1.1.1/modules/samples/src/main/scripts/axis2server.bat
    webservices/synapse/branches/1.1.1/repository/conf/wrapper.conf
    webservices/synapse/branches/1.1.1/src/main/bin/synapse.bat

Modified: webservices/synapse/branches/1.1.1/modules/samples/src/main/scripts/axis2server.bat
URL: http://svn.apache.org/viewvc/webservices/synapse/branches/1.1.1/modules/samples/src/main/scripts/axis2server.bat?rev=614821&r1=614820&r2=614821&view=diff
==============================================================================
--- webservices/synapse/branches/1.1.1/modules/samples/src/main/scripts/axis2server.bat (original)
+++ webservices/synapse/branches/1.1.1/modules/samples/src/main/scripts/axis2server.bat Thu Jan 24 00:51:19 2008
@@ -35,7 +35,7 @@
 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%\..\..\repository\conf\axis2.xml" goto checkJava
+if exist "%AXIS2_HOME%\repository\conf\axis2.xml" goto checkJava
 
 :noAxis2Home
 echo AXIS2_HOME environment variable is set incorrectly or AXIS2 could not be located.
@@ -57,6 +57,7 @@
 if ""%1""==""-http"" goto httpport
 if ""%1""==""-https"" goto httpsport
 if ""%1""==""-name"" goto servername
+if ""%1""==""-xdebug"" goto xdebug
 shift
 goto setupArgs
 
@@ -79,40 +80,56 @@
 shift
 goto setupArgs
 
+rem is there is a -xdebug in the options
+:xdebug
+set _XDEBUG="wrapper.java.additional.7=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
+shift
+goto setupArgs
+
 :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
 
+
 :runAxis2
-rem set the classes by looping through the libs
-setlocal EnableDelayedExpansion
-set AXIS2_CLASS_PATH=%AXIS2_HOME%/../../lib;%AXIS2_HOME%/../../repository/conf
-FOR %%C in ("%AXIS2_HOME%\..\..\lib\*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
-
-rem use proper bouncy castle version for the JDK
-
-"%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.4" >NUL
-IF ERRORLEVEL 1 goto checkJdk15
-echo  Using Bouncy castle JAR for Java 1.4
-FOR %%C in ("%AXIS2_HOME%\..\..\lib\bcprov-jdk13*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
-goto runServer
-
-:checkJdk15
-"%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.5" >NUL
-IF ERRORLEVEL 1 goto runServer
-echo  Using Bouncy castle JAR for Java 1.5
-FOR %%C in ("%AXIS2_HOME%\..\..\lib\bcprov-jdk15*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
-
-:runServer
-set AXIS2_ENDORSED=%AXIS2_HOME%\..\..\lib\endorsed
-echo Using JAVA_HOME    %JAVA_HOME%
-echo Using AXIS2_HOME   %AXIS2_HOME%
 
 cd %AXIS2_HOME%
-"%_JAVACMD%" %_HTTPPORT% %_HTTPSPORT% %_SERVERNAME% %JAVA_OPTS% -cp "%AXIS2_CLASS_PATH%" -Djava.io.tmpdir=%AXIS2_HOME%\..\..\work\temp\sampleServer -Djava.endorsed.dirs="%AXIS2_ENDORSED%" samples.util.SampleAxis2Server -repo "%AXIS2_HOME%\repository" -conf "%AXIS2_HOME%\repository\conf\axis2.xml"
-goto end
+echo "Starting Sample Axis2 Server ..."
+echo Using AXIS2_HOME:        %AXIS2_HOME%
+echo Using JAVA_HOME:       %JAVA_HOME%
+
+rem Decide on the wrapper binary.
+set _WRAPPER_BASE=wrapper
+set _WRAPPER_DIR=%AXIS2_HOME%..\..\bin\native\
+set _WRAPPER_EXE=%_WRAPPER_DIR%%_WRAPPER_BASE%-windows-x86-32.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_WRAPPER_DIR%%_WRAPPER_BASE%-windows-x86-64.exe
+if exist "%_WRAPPER_EXE%" goto conf
+set _WRAPPER_EXE=%_WRAPPER_DIR%%_WRAPPER_BASE%.exe
+if exist "%_WRAPPER_EXE%" goto conf
+echo Unable to locate a Wrapper executable using any of the following names:
+echo %_WRAPPER_DIR%%_WRAPPER_BASE%-windows-x86-32.exe
+echo %_WRAPPER_DIR%%_WRAPPER_BASE%-windows-x86-64.exe
+echo %_WRAPPER_DIR%%_WRAPPER_BASE%.exe
+pause
+goto :eof
+
+rem
+rem Find the wrapper.conf
+rem
+:conf
+set _WRAPPER_CONF="%AXIS2_HOME%..\..\repository\conf\sample-server-wrapper.conf"
+
+rem
+rem Start the Wrapper
+rem
+:startup
+"%_WRAPPER_EXE%" -c %_WRAPPER_CONF% wrapper.java.additional.1=%_HTTPPORT% wrapper.java.additional.2=%_HTTPSPORT% wrapper.java.additional.3=%_SERVERNAME% %_XDEBUG%
+
+if not errorlevel 1 goto :eof
+pause
 
 :end
 set _JAVACMD=

Added: webservices/synapse/branches/1.1.1/repository/conf/sample-server-wrapper.conf
URL: http://svn.apache.org/viewvc/webservices/synapse/branches/1.1.1/repository/conf/sample-server-wrapper.conf?rev=614821&view=auto
==============================================================================
--- webservices/synapse/branches/1.1.1/repository/conf/sample-server-wrapper.conf (added)
+++ webservices/synapse/branches/1.1.1/repository/conf/sample-server-wrapper.conf Thu Jan 24 00:51:19 2008
@@ -0,0 +1,111 @@
+#********************************************************************
+# Wrapper Properties
+#********************************************************************
+# Java Application
+wrapper.java.command=java
+
+# set the working directory to the SYNAPSE_HOME
+wrapper.working.dir=../..
+
+# Java Main class.  This class must implement the WrapperListener interface
+#  or guarantee that the WrapperManager class is initialized.  Helper
+#  classes are provided to do this for you.  See the Integration section
+#  of the documentation for details.
+wrapper.java.mainclass=org.tanukisoftware.wrapper.WrapperSimpleApp
+
+# Java Classpath (include wrapper.jar)  Add class path elements as
+#  needed starting from 1
+wrapper.java.classpath.1=%CLASSPATH%
+wrapper.java.classpath.2=lib/wrapper-3.2.3.jar
+wrapper.java.classpath.3=lib
+wrapper.java.classpath.4=repository/conf
+wrapper.java.classpath.5=lib/*.jar
+
+# Java Library Path (location of Wrapper.DLL or libwrapper.so)
+wrapper.java.library.path.1=lib
+
+# Java Additional Parameters
+
+wrapper.java.additional.1=-Dhttp_port
+wrapper.java.additional.2=-Dhttps_port
+wrapper.java.additional.3=-Dserver_name
+wrapper.java.additional.4=-Djava.endorsed.dirs=lib/endorsed
+wrapper.java.additional.5=-Dlog4j.configuration=file:lib/log4j.properties
+wrapper.java.additional.6=-Djava.io.tmpdir=work/temp/sampleServer
+wrapper.java.additional.7=
+
+
+# Initial Java Heap Size (in MB) - compute according to system
+wrapper.java.initmemory=128
+
+# Maximum Java Heap Size (in MB) - compute according to system
+wrapper.java.maxmemory=128
+
+# Application parameters.  Add parameters as needed starting from 1
+wrapper.app.parameter.1=samples.util.SampleAxis2Server
+wrapper.app.parameter.2=-repo %AXIS2_HOME%repository
+wrapper.app.parameter.3=-conf %AXIS2_HOME%repository\conf\axis2.xml
+
+#********************************************************************
+# Wrapper Logging Properties
+#********************************************************************
+# Format of output for the console.  (See docs for formats)
+wrapper.console.format=M
+
+# Log Level for console output.  (See docs for log levels)
+wrapper.console.loglevel=INFO
+
+# Log file to use for wrapper output logging.
+wrapper.logfile=logs/sample-server.log
+
+# Format of output for the log file.  (See docs for formats)
+wrapper.logfile.format=M
+
+# Log Level for log file output.  (See docs for log levels)
+wrapper.logfile.loglevel=INFO
+
+# Maximum size that the log file will be allowed to grow to before
+#  the log is rolled. Size is specified in bytes.  The default value
+#  of 0, disables log rolling.  May abbreviate with the 'k' (kb) or
+#  'm' (mb) suffix.  For example: 10m = 10 megabytes.
+wrapper.logfile.maxsize=5m
+
+# Maximum number of rolled log files which will be allowed before old
+#  files are deleted.  The default value of 0 implies no limit.
+wrapper.logfile.maxfiles=5
+
+# Log Level for sys/event log output.  (See docs for log levels)
+wrapper.syslog.loglevel=NONE
+
+#********************************************************************
+# Wrapper Windows Properties
+#********************************************************************
+# Title to use when running as a console
+wrapper.console.title=Sample Axis2 Server
+
+#********************************************************************
+# Wrapper Windows NT/2000/XP Service Properties
+#********************************************************************
+# WARNING - Do not modify any of these properties when an application
+#  using this configuration file has been installed as a service.
+#  Please uninstall the service before modifying this section.  The
+#  service can then be reinstalled.
+
+# Name of the service
+#wrapper.ntservice.name=SampleAxis2Server
+
+# Display name of the service
+#wrapper.ntservice.displayname=Sample Axis2 Server
+
+# Description of the service
+#wrapper.ntservice.description=Sample Axis2 Server
+
+# Service dependencies.  Add dependencies as needed starting from 1
+#wrapper.ntservice.dependency.1=
+
+# Mode in which the service is installed.  AUTO_START or DEMAND_START
+#wrapper.ntservice.starttype=AUTO_START
+
+# Allow the service to interact with the desktop.
+#wrapper.ntservice.interactive=false
+

Modified: webservices/synapse/branches/1.1.1/repository/conf/wrapper.conf
URL: http://svn.apache.org/viewvc/webservices/synapse/branches/1.1.1/repository/conf/wrapper.conf?rev=614821&r1=614820&r2=614821&view=diff
==============================================================================
--- webservices/synapse/branches/1.1.1/repository/conf/wrapper.conf (original)
+++ webservices/synapse/branches/1.1.1/repository/conf/wrapper.conf Thu Jan 24 00:51:19 2008
@@ -35,6 +35,7 @@
 wrapper.java.additional.7=-Dlog4j.configuration=file:lib/log4j.properties
 wrapper.java.additional.8=-Djava.io.tmpdir=work/temp/synapse
 wrapper.java.additional.9=-Dresolve.root=repository
+wrapper.java.additional.10=
 
 # Initial Java Heap Size (in MB)
 wrapper.java.initmemory=128
@@ -50,7 +51,7 @@
 # Wrapper Logging Properties
 #********************************************************************
 # Format of output for the console.  (See docs for formats)
-wrapper.console.format=PM
+wrapper.console.format=M
 
 # Log Level for console output.  (See docs for log levels)
 wrapper.console.loglevel=INFO
@@ -59,7 +60,7 @@
 wrapper.logfile=logs/wrapper.log
 
 # Format of output for the log file.  (See docs for formats)
-wrapper.logfile.format=LPTM
+wrapper.logfile.format=M
 
 # Log Level for log file output.  (See docs for log levels)
 wrapper.logfile.loglevel=INFO

Modified: webservices/synapse/branches/1.1.1/src/main/bin/synapse.bat
URL: http://svn.apache.org/viewvc/webservices/synapse/branches/1.1.1/src/main/bin/synapse.bat?rev=614821&r1=614820&r2=614821&view=diff
==============================================================================
--- webservices/synapse/branches/1.1.1/src/main/bin/synapse.bat (original)
+++ webservices/synapse/branches/1.1.1/src/main/bin/synapse.bat Thu Jan 24 00:51:19 2008
@@ -1,30 +1,84 @@
 @echo off
-setlocal
 
-rem Copyright (c) 1999, 2006 Tanuki Software Inc.
-rem
-rem Java Service Wrapper general startup script
-rem
-
-rem
-rem Resolve the real path of the wrapper.exe
-rem  For non NT systems, the _REALPATH and _WRAPPER_CONF values
-rem  can be hard-coded below and the following test removed.
-rem
-if "%OS%"=="Windows_NT" goto nt
-echo This script only works with NT-based versions of Windows.
-goto :eof
-
-:nt
-rem
-rem Find the application home.
-rem
-rem %~dp0 is location of current script under NT
-set _REALPATH=%~dp0..\
+REM Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+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.
+
+if "%OS%"=="Windows_NT" @setlocal
+if "%OS%"=="WINNT" @setlocal
+
+rem %~dp0 is expanded pathname of the current script under NT
+set SYNAPSE_HOME=%~dps0..
+
+set _SYNAPSE_XML=-Dsynapse.xml="%SYNAPSE_HOME%\repository\conf\synapse.xml"
+set _XDEBUG=
+
+rem Slurp the command line arguments. This loop allows for an unlimited number
+rem of arguments (up to the command line limit, anyway).
+
+:setupArgs
+if ""%1""=="""" goto doneStart
+if ""%1""==""-sample"" goto SYNAPSESample
+if ""%1""==""-xdebug"" goto xdebug
+shift
+goto setupArgs
+
+rem is there is a -xdebug in the options
+:xdebug
+
+
+set _XDEBUG="wrapper.java.additional.10=-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000"
+shift
+goto setupArgs
+
+:SYNAPSESample
+shift
+set _SYNAPSE_XML=-Dsynapse.xml="%SYNAPSE_HOME%\repository\conf\sample\synapse_sample_%1.xml"
+shift
+goto setupArgs
+
+:doneStart
+rem find SYNAPSE_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 "%SYNAPSE_HOME%\README.TXT" goto checkJava
+
+:noSYNAPSEHome
+echo SYNAPSE_HOME is set incorrectly or WSO2 SYNAPSE could not be located. Please set SYNAPSE_HOME.
+goto end
+
+:checkJava
+set _JAVACMD=%JAVACMD%
+
+if "%JAVA_HOME%" == "" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD="%JAVA_HOME%\bin\java.exe"
+goto runServer
+
+:noJavaHome
+if "%_JAVACMD%" == "" set _JAVACMD=java.exe
+echo JAVA_HOME variable not defined or incorrect. Please set JAVA_HOME.
+
+:runServer
+@rem @echo on
+cd %SYNAPSE_HOME%
+echo "Starting WSO2 Enterprise Service Bus ..."
+echo Using SYNAPSE_HOME:        %SYNAPSE_HOME%
+echo Using JAVA_HOME:       %JAVA_HOME%
+echo Using SYNAPSE_XML:     %_SYNAPSE_XML%
 
 rem Decide on the wrapper binary.
 set _WRAPPER_BASE=wrapper
-set _WRAPPER_DIR=%_REALPATH%bin\native\
+set _WRAPPER_DIR=%SYNAPSE_HOME%\bin\native\
 set _WRAPPER_EXE=%_WRAPPER_DIR%%_WRAPPER_BASE%-windows-x86-32.exe
 if exist "%_WRAPPER_EXE%" goto conf
 set _WRAPPER_EXE=%_WRAPPER_DIR%%_WRAPPER_BASE%-windows-x86-64.exe
@@ -32,9 +86,9 @@
 set _WRAPPER_EXE=%_WRAPPER_DIR%%_WRAPPER_BASE%.exe
 if exist "%_WRAPPER_EXE%" goto conf
 echo Unable to locate a Wrapper executable using any of the following names:
-echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-32.exe
-echo %_REALPATH%%_WRAPPER_BASE%-windows-x86-64.exe
-echo %_REALPATH%%_WRAPPER_BASE%.exe
+echo %_WRAPPER_DIR%%_WRAPPER_BASE%-windows-x86-32.exe
+echo %_WRAPPER_DIR%%_WRAPPER_BASE%-windows-x86-64.exe
+echo %_WRAPPER_DIR%%_WRAPPER_BASE%.exe
 pause
 goto :eof
 
@@ -42,15 +96,23 @@
 rem Find the wrapper.conf
 rem
 :conf
-set _WRAPPER_CONF="%~f1"
-if not %_WRAPPER_CONF%=="" goto startup
-set _WRAPPER_CONF="%_REALPATH%repository\conf\wrapper.conf"
+set _WRAPPER_CONF="%SYNAPSE_HOME%\repository\conf\wrapper.conf"
 
 rem
 rem Start the Wrapper
 rem
 :startup
-"%_WRAPPER_EXE%" -c %_WRAPPER_CONF%
+"%_WRAPPER_EXE%" -c %_WRAPPER_CONF% wrapper.java.additional.1=%_SYNAPSE_XML% %_XDEBUG%
+
 if not errorlevel 1 goto :eof
 pause
 
+
+:end
+set _JAVACMD=
+set SYNAPSE_CMD_LINE_ARGS=
+
+if "%OS%"=="Windows_NT" @endlocal
+if "%OS%"=="WINNT" @endlocal
+
+:mainEnd



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org