qwertyqwerty Posted June 28, 2006 Posted June 28, 2006 Hi All, I am tryign to start the tomcat server in a hidden mode - but the following script fails to start the server. what am I missing? Run ("C:\tomcat\jakarta-tomcat-5.5.9\bin\startup.bat", "", @SW_HIDE)
w0uter Posted June 28, 2006 Posted June 28, 2006 what is the contents of startup.bat ? My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
qwertyqwerty Posted June 28, 2006 Author Posted June 28, 2006 w0uter said: what is the contents of startup.bat ?@echo offif "%OS%" == "Windows_NT" setlocalrem ---------------------------------------------------------------------------rem Start script for the CATALINA Serverremrem $Id: startup.bat,v 1.6 2004/05/27 18:25:11 yoavs Exp $rem ---------------------------------------------------------------------------rem Guess CATALINA_HOME if not definedset CURRENT_DIR=%cd%if not "%CATALINA_HOME%" == "" goto gotHomeset CATALINA_HOME=%CURRENT_DIR%if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHomecd ..set CATALINA_HOME=%cd%cd %CURRENT_DIR%:gotHomeif exist "%CATALINA_HOME%\bin\catalina.bat" goto okHomeecho The CATALINA_HOME environment variable is not defined correctlyecho This environment variable is needed to run this programgoto end:okHomeset EXECUTABLE=%CATALINA_HOME%\bin\catalina.batrem Check that target executable existsif exist "%EXECUTABLE%" goto okExececho Cannot find %EXECUTABLE%echo This file is needed to run this programgoto end:okExecrem Get remaining unshifted command line arguments and save them in theset CMD_LINE_ARGS=:setArgsif ""%1""=="""" goto doneSetArgsset CMD_LINE_ARGS=%CMD_LINE_ARGS% %1shiftgoto setArgs:doneSetArgscall "%EXECUTABLE%" start %CMD_LINE_ARGS%:end
w0uter Posted June 28, 2006 Posted June 28, 2006 well seeing as how it calls catalina.bat also post the contents of that one please My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
qwertyqwerty Posted June 28, 2006 Author Posted June 28, 2006 w0uter said: well seeing as how it calls catalina.bat also post the contents of that one please @echo offif "%OS%" == "Windows_NT" setlocalrem ---------------------------------------------------------------------------rem Start/Stop Script for the CATALINA Serverremrem Environment Variable Prequisitesremrem CATALINA_HOME May point at your Catalina "build" directory.remrem CATALINA_BASE (Optional) Base directory for resolving dynamic portionsrem of a Catalina installation. If not present, resolves torem the same directory that CATALINA_HOME points to.remrem CATALINA_OPTS (Optional) Java runtime options used when the "start",rem "stop", or "run" command is executed.remrem CATALINA_TMPDIR (Optional) Directory path location of temporary directoryrem the JVM should use (java.io.tmpdir). Defaults torem %CATALINA_BASE%\temp.remrem JAVA_HOME Must point at your Java Development Kit installation.remrem JAVA_OPTS (Optional) Java runtime options used when the "start",rem "stop", or "run" command is executed.remrem JSSE_HOME (Optional) May point at your Java Secure Sockets Extensionrem (JSSE) installation, whose JAR files will be added to therem system class path used to start Tomcat.remrem JPDA_TRANSPORT (Optional) JPDA transport used when the "jpda start"rem command is executed. The default is "dt_shmem".remrem JPDA_ADDRESS (Optional) Java runtime options used when the "jpda start"rem command is executed. The default is "jdbconn".remrem $Id: catalina.bat,v 1.12 2005/03/03 15:13:39 remm Exp $rem ---------------------------------------------------------------------------rem Guess CATALINA_HOME if not definedset CURRENT_DIR=%cd%if not "%CATALINA_HOME%" == "" goto gotHomeset CATALINA_HOME=%CURRENT_DIR%if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHomecd ..set CATALINA_HOME=%cd%cd %CURRENT_DIR%:gotHomeif exist "%CATALINA_HOME%\bin\catalina.bat" goto okHomeecho The CATALINA_HOME environment variable is not defined correctlyecho This environment variable is needed to run this programgoto end:okHomerem Get standard environment variablesif exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"rem Get standard Java environment variablesif exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspathecho Cannot find %CATALINA_HOME%\bin\setclasspath.batecho This file is needed to run this programgoto end:okSetclasspathset BASEDIR=%CATALINA_HOME%call "%CATALINA_HOME%\bin\setclasspath.bat"rem Add on extra jar files to CLASSPATHif "%JSSE_HOME%" == "" goto noJsseset CLASSPATH=%CLASSPATH%;%JSSE_HOME%\lib\jcert.jar;%JSSE_HOME%\lib\jnet.jar;%JSSE_HOME%\lib\jsse.jar:noJsseset CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\bootstrap.jarif not "%CATALINA_BASE%" == "" goto gotBaseset CATALINA_BASE=%CATALINA_HOME%:gotBaseif not "%CATALINA_TMPDIR%" == "" goto gotTmpdirset CATALINA_TMPDIR=%CATALINA_BASE%\temp:gotTmpdirif not exist "%CATALINA_HOME%\bin\tomcat-juli.jar" goto noJuliset JAVA_OPTS=%JAVA_OPTS% -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager:noJulirem ----- Execute The Requested Command ---------------------------------------echo Using CATALINA_BASE: %CATALINA_BASE%echo Using CATALINA_HOME: %CATALINA_HOME%echo Using CATALINA_TMPDIR: %CATALINA_TMPDIR%echo Using JAVA_HOME: %JAVA_HOME%set _EXECJAVA=%_RUNJAVA%set MAINCLASS=org.apache.catalina.startup.Bootstrapset ACTION=startset SECURITY_POLICY_FILE=set DEBUG_OPTS=set JPDA=if not ""%1"" == ""jpda"" goto noJpdaset JPDA=jpdaif not "%JPDA_TRANSPORT%" == "" goto gotJpdaTransportset JPDA_TRANSPORT=dt_shmem:gotJpdaTransportif not "%JPDA_ADDRESS%" == "" goto gotJpdaAddressset JPDA_ADDRESS=jdbconn:gotJpdaAddressshift:noJpdaif ""%1"" == ""debug"" goto doDebugif ""%1"" == ""run"" goto doRunif ""%1"" == ""start"" goto doStartif ""%1"" == ""stop"" goto doStopif ""%1"" == ""version"" goto doVersionecho Usage: catalina ( commands ... )echo commands:echo debug Start Catalina in a debuggerecho debug -security Debug Catalina with a security managerecho jpda start Start Catalina under JPDA debuggerecho run Start Catalina in the current windowecho run -security Start in the current window with security managerecho start Start Catalina in a separate windowecho start -security Start in a separate window with security managerecho stop Stop Catalinaecho version What version of tomcat are you running?goto end:doDebugshiftset _EXECJAVA=%_RUNJDB%set DEBUG_OPTS=-sourcepath "%CATALINA_HOME%\..\..\jakarta-tomcat-catalina\catalina\src\share"if not ""%1"" == ""-security"" goto execCmdshiftecho Using Security Managerset SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policygoto execCmd:doRunshiftif not ""%1"" == ""-security"" goto execCmdshiftecho Using Security Managerset SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policygoto execCmd:doStartshiftif not "%OS%" == "Windows_NT" goto noTitleset _EXECJAVA=start "Tomcat" %_RUNJAVA%goto gotTitle:noTitleset _EXECJAVA=start %_RUNJAVA%:gotTitleif not ""%1"" == ""-security"" goto execCmdshiftecho Using Security Managerset SECURITY_POLICY_FILE=%CATALINA_BASE%\conf\catalina.policygoto execCmd:doStopshiftset ACTION=stopgoto execCmd:doVersion%_EXECJAVA% -classpath "%CATALINA_HOME%\server\lib\catalina.jar" org.apache.catalina.util.ServerInfogoto end:execCmdrem Get remaining unshifted command line arguments and save them in theset CMD_LINE_ARGS=:setArgsif ""%1""=="""" goto doneSetArgsset CMD_LINE_ARGS=%CMD_LINE_ARGS% %1shiftgoto setArgs:doneSetArgsrem Execute Java with the applicable propertiesif not "%JPDA%" == "" goto doJpdaif not "%SECURITY_POLICY_FILE%" == "" goto doSecurity%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%goto end:doSecurity%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%goto end:doJpdaif not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%goto end:doSecurityJpda%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% -Xdebug -Xrunjdwp:transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=n %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION%goto end:end
qwertyqwerty Posted June 28, 2006 Author Posted June 28, 2006 --setclasspath.bat rem --------------------------------------------------------------------------- rem Set CLASSPATH and Java options rem rem $Id: setclasspath.bat,v 1.7 2004/07/26 15:34:31 yoavs Exp $ rem --------------------------------------------------------------------------- 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 goto exit :gotJavaHome if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome if not exist "%JAVA_HOME%\bin\javaw.exe" goto noJavaHome if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome if not exist "%JAVA_HOME%\bin\javac.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 not a JRE goto exit :okJavaHome if not "%BASEDIR%" == "" goto gotBasedir echo The BASEDIR environment variable is not defined echo This environment variable is needed to run this program goto exit :gotBasedir if exist "%BASEDIR%\bin\setclasspath.bat" goto okBasedir echo The BASEDIR environment variable is not defined correctly echo This environment variable is needed to run this program goto exit :okBasedir rem Set the default -Djava.endorsed.dirs argument set JAVA_ENDORSED_DIRS=%BASEDIR%\common\endorsed rem Set standard CLASSPATH rem Note that there are no quotes as we do not want to introduce random rem quotes into the CLASSPATH set CLASSPATH=%JAVA_HOME%\lib\tools.jar rem Set standard command for invoking Java. rem Note that NT requires a window name argument when using start. rem Also note the quoting as JAVA_HOME may contain spaces. set _RUNJAVA="%JAVA_HOME%\bin\java" set _RUNJAVAW="%JAVA_HOME%\bin\javaw" set _RUNJDB="%JAVA_HOME%\bin\jdb" set _RUNJAVAC="%JAVA_HOME%\bin\javac" goto end :exit exit /b 1 :end
w0uter Posted June 28, 2006 Posted June 28, 2006 AFAIK you can either: A) recode the batches to autoit (lots of work) just use WinSetState(,@SW_HIDE) after you have run the batch. thats about all i can think of, i would go for B. My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll
qwertyqwerty Posted June 28, 2006 Author Posted June 28, 2006 w0uter said: AFAIK you can either:A) recode the batches to autoit (lots of work) just use WinSetState(,@SW_HIDE) after you have run the batch.thats about all i can think of, i would go for B.Thanks for the help! But the problem is that even a simple run statement (below) does not start the server!run ("C:\tomcat\jakarta-tomcat-5.5.9\bin\startup.bat")
qwertyqwerty Posted June 28, 2006 Author Posted June 28, 2006 (edited) solved the problem!! catalina_home env variable need to be declared in order to run the bat file from command line!! RunWait("c:\tomcat\jakarta-tomcat-5.5.9\bin\startup.bat") WinWaitActive ("Tomcat", "") WinSetState ("Tomcat", "", @SW_HIDE) Thanks so much w0uter !! Edited June 28, 2006 by qwertyqwerty
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now