Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@www.apache.org Received: (qmail 95677 invoked from network); 23 Dec 2003 06:51:34 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 23 Dec 2003 06:51:34 -0000 Received: (qmail 38324 invoked by uid 500); 23 Dec 2003 06:50:47 -0000 Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 38305 invoked by uid 500); 23 Dec 2003 06:50:47 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 38288 invoked from network); 23 Dec 2003 06:50:47 -0000 Received: from unknown (HELO sccrmhc12.comcast.net) (204.127.202.56) by daedalus.apache.org with SMTP; 23 Dec 2003 06:50:47 -0000 Received: from nicki.visi.com (c-24-118-224-155.mn.client2.attbi.com[24.118.224.155]) by comcast.net (sccrmhc12) with SMTP id <2003122306505701200sbgu6e>; Tue, 23 Dec 2003 06:50:57 +0000 Message-Id: <5.2.1.1.0.20031223004518.02bdd008@shell.visi.com> X-Sender: hoju@shell.visi.com X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Tue, 23 Dec 2003 00:50:54 -0600 To: "Tomcat Users List" From: Jacob Kjome Subject: Re: How to: Tomcat 5.0.16 as Windows Service In-Reply-To: References: <16035281.1072104979781.JavaMail.root@louie.psp.pas.earthlink.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_149505453==_" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --=====================_149505453==_ Content-Type: text/plain; charset="us-ascii"; format=flowed Thanks for the script, Bill. I've been looking for something that actually works and this finally does....almost.... The script is missing one important thing. It doesn't include %JAVA_HOME%\lib\tools.jar in the --ImagePath which causes JSP compilation to fail. Attached is a modified script that fixes that and adds -Djava.io.tmpdir and adds some -Xms and -Xmx stuff. BTW, I tried adding -server, but the service wouldn't start when it was added. Any idea why? How else do I specify Tomcat to use the -server JVM rather than the default -client? Jake At 08:47 PM 12/22/2003 -0800, you wrote: >One of the other developers added the attached .bat file to make it easier >to install as a service (I renamed the attachment to '.txt', since a lot of >mail servers strip '.bat' attachments :). rename it back to '.bat', and see >if it help. > > Usage: service.bat install/remove [service_name] > >service_name defaults to Tomcat5 if not specified. > >"Merrill Cornish" wrote in message >news:16035281.1072104979781.JavaMail.root@louie.psp.pas.earthlink.net... > > Bill, > > > > Yes, I should have thought of the --StdOutFile and --StdErrorFile >arguments. However, specifying them does no good. The files are created, >but they are empty. > > > > Merrill > > > > > > >--------------------------------------------------------------------- >To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org >For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --=====================_149505453==_ Content-Type: text/plain; charset="us-ascii" @echo off if "%OS%" == "Windows_NT" setlocal rem --------------------------------------------------------------------------- rem NT Service Install/Uninstall script rem rem Options rem install Install the service using Tomcat5 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,v 1.1 2003/12/22 13:48:52 mturk Exp $ rem --------------------------------------------------------------------------- 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\tomcat.exe" goto okHome rem CD to the upper dir cd .. set CATALINA_HOME=%cd% :gotHome if exist "%CATALINA_HOME%\bin\tomcat.exe" goto okHome echo The tomcat.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 set EXECUTABLE=%CATALINA_HOME%\bin\tomcat.exe rem Set default Service name set SERVICE_NAME=Tomcat5 if "%1" == "" goto displayUsage if "%2" == "" goto setServiceName set SERVICE_NAME=%2 :setServiceName if %1 == install goto doInstall if %1 == remove goto doRemove echo Unknown parameter "%1" :displayUsage echo echo Usage: service.bat install/remove [service_name] goto end :doRemove rem Remove the service %EXECUTABLE% //DS//%SERVICE_NAME% echo The service '%SERVICE_NAME%' has been removed goto end :doInstall rem Install the service %EXECUTABLE% //IS//%SERVICE_NAME% --DisplayName "Apache Tomcat" --Description "Apache Tomcat Server - http://jakarta.apache.org/tomcat/" --Install "%EXECUTABLE%" --ImagePath "%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar" --StartupClass org.apache.catalina.startup.Bootstrap;main;start --ShutdownClass org.apache.catalina.startup.Bootstrap;main;stop --Java java --Startup manual rem Set extra parameters %EXECUTABLE% //US//%SERVICE_NAME% --JavaOptions -Dcatalina.home="\"%CATALINA_HOME%\""#-Djava.endorsed.dirs="\"%CATALINA_HOME%\common\endorsed\""#-Djava.io.tmpdir="\"%CATALINA_HOME%\temp\""#-Xms32m#-Xmx256m#-Xrs --StdOutputFile "%CATALINA_HOME%\logs\stdout.log" --StdErrorFile "%CATALINA_HOME%\logs\stderr.log" --WorkingPath "%CATALINA_HOME%\bin" echo The service '%SERVICE_NAME%' has been installed :end cd %CURRENT_DIR% --=====================_149505453==_ Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --=====================_149505453==_--