Starting DOORS Web Access as a Windows Service

Hi, all,

I'm reviewing this Technote about starting DOORS Web Access as a Windows Service and I'd like some help creating a Windows batch file to invoke and keep DWA running.

I'm fairly confident I can follow the remainder of the instructions in the Technote, I just don't know how to create the bat files as specified.

I can manually start DWA via the three steps needed:
1. E:\IBM\Rational\DOORS Web Access\1.3.0.0\broker.start.bat
2. E:\IBM\Rational\DOORS\9.2.\bin\doors.exe –interop –data 36677@localhost -brokerHost localhost –brokerPort 61616
3. E:\IBM\Rational\DOORS Web Access\1.3.0.0\server.start.bat

The Technote talks about a typical Windows DOORS Web Access start script that should "Wait for the DWA broker to start" and "Wait for the Interoperation server to start"... My "bat fu" is weak.

Any suggestions on how to write a bat file that will start (and stop) these various components?

Thank you!
ghc - Tue Jun 15 13:36:25 EDT 2010

Re: Starting DOORS Web Access as a Windows Service
Arllen - Wed Jun 16 10:19:10 EDT 2010

Hi,

Regarding your statement:
The Technote talks about a typical Windows DOORS Web Access start script that should "Wait for the DWA broker to start" and "Wait for the Interoperation server to start"... My "bat fu" is weak.

I encourage you to submit this (and any other) feedback to the tech note author, so the tech note can be improved (there's a feedback form at the very bottom of the tech note).

I know of a couple of different ways to make a DOS script wait:

1. Use the sleep command, courtesy of Windows 2003 Resource kit:
http://www.microsoft.com/downloads/details.aspx?FamilyID=9D467A69-57FF-4AE7-96EE-B18C4790CFFD&displaylang=en

2. If you don't want to get the sleep command, you can emulate sleep using this ping hack:

PING <invalid_host> -n 1 -w <time_in_ms> >NUL
-n 1 ==> send one echo request
-w ==> time (in ms) to wait before timing out


Using ping like this with an invalid host will result in a pause for the specified time, emulating sleep.
Example that times out in 30 sec.:

 

PING 1.1.1.1 -n 1 -w 30000 >NUL



To write the .bat file, put the commands in the correct order. Feel free to use variables/parameters to make the script more flexible/portable. You may want to create a special user to run the DWA start/stop scripts, so it's easy to spot which processes belong to DWA when using the Windows Task Manager.

Hope this helps,

Arllen



 

Re: Starting DOORS Web Access as a Windows Service
PDU - Thu Jun 17 02:12:29 EDT 2010

Hi,

what i have done (DOORS 9.1 / Windows Vista) :
(i use port 36678 for DOORS)

Start_DWA.bat

rem Go in the folder where are batch files 
cd "\Program Files\Telelogic\DWA"
 
rem Stop Windows  DOORS 9.1 service
net stop "DOORS DB Server 9.1"
 
rem Start DWA Broker
start "DWA Broker" /MIN "dwaBroker.start.bat"
choice /d o /t 120 > nul
 
rem Start DOORS Server
rem Init   (to be sure)
rem Stop and Start again
net start "DOORS DB Server 9.1"
start "SetUp DCN Service" /MIN "DOORS9-1_SetUpDCNservice.bat"
choice /d o /t 20 > nul
net stop "DOORS DB Server 9.1"
net start "DOORS DB Server 9.1"
choice /d o /t 20 > nul
 
rem Start Interoperation Server
start "SetUp Inter Operation Server" /MIN "DOORS9-1_SetUpInterOperationServer.bat"
choice /d o /t 120 > nul
 
rem Start le DWA Server 
start "DWA Server" /MIN "dwaServer.start.bat"
choice /d o /t 60 > nul

 


with :

dwaBroker.start.bat

 

 

@echo off
rem ----------------------------------------------
rem Startup script for the DWA broker on win32
rem ----------------------------------------------
 
SETLOCAL
set JRE_HOME=%cd%\win32\ibm-java2-i386-50\jre
set JAVA_HOME=%cd%\win32\ibm-java2-i386-50\jre
 
rem Do not change this directive unless you are sure of what you are doing.
rem (Changing the heap size alone will not improve performance, throughput or resilience.)
set ACTIVEMQ_OPTS=-Xmx128M -XX:+HeapDumpOnCtrlBreak -Dorg.apache.activemq.UseDedicatedTaskRunner=true
 
rem If you wish to run multiple instances of DwaBroker on a single host, this parameter needs to be unique for each instance
rem N.B. You must must make the corresponding change to dwaBroker.shutdown.bat
rem set BROKER_ADMIN_PORT=1099
set BROKER_ADMIN_PORT=1100
set SUNJMX=-Dcom.sun.management.jmxremote.port=%BROKER_ADMIN_PORT% -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
 
call "%cd%\dwaBroker\bin\activemq-admin.bat" "start"
ENDLOCAL



DOORS9-1_SetUpDCNservice.bat



 

 

rem 
rem    DOORS 9.1 Serveur
rem
rem    SetUp DCN services 
rem
"C:\Program Files\Telelogic\DOORS 9.1\bin\dbadmin" -data 36678@127.0.0.1 -dcnEnable -dcnBrokerUri "tcp://127.0.0.1:61616" -dcnChannelName "dcn"



DOORS9-1_SetUpInterOperationServer.bat



 

 

rem 
rem    DOORS 9.1 Serveur
rem
rem    SetUp Inter Operation Server
rem
"C:\Program Files\Telelogic\DOORS 9.1\bin\doors" -interop -data 36678@127.0.0.1 -brokerHost 127.0.0.1 -brokerPort 61616



dwaServer.start.bat



 

 

@echo off
rem ----------------------------------------------
rem Startup script for the DWA server on win32
rem ----------------------------------------------
 
SETLOCAL
set CATALINA_HOME=%cd%\dwaServer
set JRE_HOME=%cd%\win32\ibm-java2-i386-50\jre
set JAVA_HOME=
 
set JAVA_OPTS=-Djava.library.path="%cd%"\win32\jni\
 
rem uncomment the following line for JMX support.
rem set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
 
rem uncomment the following line to enable assertions
rem set JAVA_OPTS=%JAVA_OPTS% -enableassertions"
 
rem Required DWA configuration
rem You may increase the amount of memory allocated to dwaServer by adjusting the value below.
rem e.g. JAVA_OPTS="-Xmx1024M $JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:+HeapDumpOnCtrlBreak"
rem N.B. It is not recommended to allocate more than 2GB of memory to DWA unless you understand 
rem      the implications of doing so.
set JAVA_OPTS=%JAVA_OPTS% -Xmx512M -XX:+HeapDumpOnOutOfMemoryError -XX:+HeapDumpOnCtrlBreak
 
if exist "%FESTIVAL_HOME%" goto existsFestivalHome
   set JAVA_OPTS=%JAVA_OPTS% -Dcom.telelogic.tds.configfile.location="%CATALINA_HOME%"\festival\config\
   set JAVA_OPTS=%JAVA_OPTS% -Dfestival.home="%CATALINA_HOME%"\festival\
   goto doneSetEnvironment
 
:existsFestivalHome
 
set JAVA_OPTS=%JAVA_OPTS% -Dcom.telelogic.tds.configfile.location="%FESTIVAL_HOME%"\config\
:doneSetEnvironment
 
call "%cd%\dwaServer\bin\startup.bat"
 
ENDLOCAL


Pierre

 

Re: Starting DOORS Web Access as a Windows Service
Arllen - Thu Jun 17 11:15:59 EDT 2010

PDU - Thu Jun 17 02:12:29 EDT 2010

Hi,

what i have done (DOORS 9.1 / Windows Vista) :
(i use port 36678 for DOORS)

Start_DWA.bat

rem Go in the folder where are batch files 
cd "\Program Files\Telelogic\DWA"
 
rem Stop Windows  DOORS 9.1 service
net stop "DOORS DB Server 9.1"
 
rem Start DWA Broker
start "DWA Broker" /MIN "dwaBroker.start.bat"
choice /d o /t 120 > nul
 
rem Start DOORS Server
rem Init   (to be sure)
rem Stop and Start again
net start "DOORS DB Server 9.1"
start "SetUp DCN Service" /MIN "DOORS9-1_SetUpDCNservice.bat"
choice /d o /t 20 > nul
net stop "DOORS DB Server 9.1"
net start "DOORS DB Server 9.1"
choice /d o /t 20 > nul
 
rem Start Interoperation Server
start "SetUp Inter Operation Server" /MIN "DOORS9-1_SetUpInterOperationServer.bat"
choice /d o /t 120 > nul
 
rem Start le DWA Server 
start "DWA Server" /MIN "dwaServer.start.bat"
choice /d o /t 60 > nul

 


with :

dwaBroker.start.bat

 

 

@echo off
rem ----------------------------------------------
rem Startup script for the DWA broker on win32
rem ----------------------------------------------
 
SETLOCAL
set JRE_HOME=%cd%\win32\ibm-java2-i386-50\jre
set JAVA_HOME=%cd%\win32\ibm-java2-i386-50\jre
 
rem Do not change this directive unless you are sure of what you are doing.
rem (Changing the heap size alone will not improve performance, throughput or resilience.)
set ACTIVEMQ_OPTS=-Xmx128M -XX:+HeapDumpOnCtrlBreak -Dorg.apache.activemq.UseDedicatedTaskRunner=true
 
rem If you wish to run multiple instances of DwaBroker on a single host, this parameter needs to be unique for each instance
rem N.B. You must must make the corresponding change to dwaBroker.shutdown.bat
rem set BROKER_ADMIN_PORT=1099
set BROKER_ADMIN_PORT=1100
set SUNJMX=-Dcom.sun.management.jmxremote.port=%BROKER_ADMIN_PORT% -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
 
call "%cd%\dwaBroker\bin\activemq-admin.bat" "start"
ENDLOCAL



DOORS9-1_SetUpDCNservice.bat



 

 

rem 
rem    DOORS 9.1 Serveur
rem
rem    SetUp DCN services 
rem
"C:\Program Files\Telelogic\DOORS 9.1\bin\dbadmin" -data 36678@127.0.0.1 -dcnEnable -dcnBrokerUri "tcp://127.0.0.1:61616" -dcnChannelName "dcn"



DOORS9-1_SetUpInterOperationServer.bat



 

 

rem 
rem    DOORS 9.1 Serveur
rem
rem    SetUp Inter Operation Server
rem
"C:\Program Files\Telelogic\DOORS 9.1\bin\doors" -interop -data 36678@127.0.0.1 -brokerHost 127.0.0.1 -brokerPort 61616



dwaServer.start.bat



 

 

@echo off
rem ----------------------------------------------
rem Startup script for the DWA server on win32
rem ----------------------------------------------
 
SETLOCAL
set CATALINA_HOME=%cd%\dwaServer
set JRE_HOME=%cd%\win32\ibm-java2-i386-50\jre
set JAVA_HOME=
 
set JAVA_OPTS=-Djava.library.path="%cd%"\win32\jni\
 
rem uncomment the following line for JMX support.
rem set JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=9004 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false
 
rem uncomment the following line to enable assertions
rem set JAVA_OPTS=%JAVA_OPTS% -enableassertions"
 
rem Required DWA configuration
rem You may increase the amount of memory allocated to dwaServer by adjusting the value below.
rem e.g. JAVA_OPTS="-Xmx1024M $JAVA_OPTS -XX:+HeapDumpOnOutOfMemoryError -XX:+HeapDumpOnCtrlBreak"
rem N.B. It is not recommended to allocate more than 2GB of memory to DWA unless you understand 
rem      the implications of doing so.
set JAVA_OPTS=%JAVA_OPTS% -Xmx512M -XX:+HeapDumpOnOutOfMemoryError -XX:+HeapDumpOnCtrlBreak
 
if exist "%FESTIVAL_HOME%" goto existsFestivalHome
   set JAVA_OPTS=%JAVA_OPTS% -Dcom.telelogic.tds.configfile.location="%CATALINA_HOME%"\festival\config\
   set JAVA_OPTS=%JAVA_OPTS% -Dfestival.home="%CATALINA_HOME%"\festival\
   goto doneSetEnvironment
 
:existsFestivalHome
 
set JAVA_OPTS=%JAVA_OPTS% -Dcom.telelogic.tds.configfile.location="%FESTIVAL_HOME%"\config\
:doneSetEnvironment
 
call "%cd%\dwaServer\bin\startup.bat"
 
ENDLOCAL


Pierre

 

Hi Pierre,

I noticed that you are shutting down/restarting DOORS as part of the DWA startup sequence. That is not necessary -- DOORS can be running when you start DWA. This allows you to simplify your DWA startup sequence. I suspect your scripts are going through the extra work because the DWA Install guide tells you to. This is no longer necessary; the documentation will be fixed in a future release (APAR PM04431).

Regards,

Arllen

Re: Starting DOORS Web Access as a Windows Service
PDU - Thu Jun 17 11:57:29 EDT 2010

Arllen - Thu Jun 17 11:15:59 EDT 2010
Hi Pierre,

I noticed that you are shutting down/restarting DOORS as part of the DWA startup sequence. That is not necessary -- DOORS can be running when you start DWA. This allows you to simplify your DWA startup sequence. I suspect your scripts are going through the extra work because the DWA Install guide tells you to. This is no longer necessary; the documentation will be fixed in a future release (APAR PM04431).

Regards,

Arllen

Thanks Arllen,

but it is not a problem for me, because this sequence is done automatically each night.

Pierre

Re: Starting DOORS Web Access as a Windows Service
ghc - Fri Jun 18 17:24:38 EDT 2010

Thank you PDU and arllen! Very helpful examples and tips.

I sincerely appreciate it.

Re: Starting DOORS Web Access as a Windows Service
Arllen - Wed Jun 23 13:21:24 EDT 2010

ghc - Fri Jun 18 17:24:38 EDT 2010
Thank you PDU and arllen! Very helpful examples and tips.

I sincerely appreciate it.

Hi,

I wanted to let you know that the tech note has been updated. I added information about:
  • making a DOS script wait
  • stopping the Interoperation server process from the DWA stop script

I am not able to include sample scripts at this time, but will investigate the possibility of adding them.

I look forward to your feedback.

Thanks,

Arllen