JavaService kills JBoss!
augustynr Oct 30, 2002 4:57 PMHi,
I have an app which runs on Jboss 303 with embeded Tomcat 4.12 on JDK 1.4.1
This app runs fine when run from the default run.bat file.
When installed as a service, process eats up all memory and crushes without any messages. This happens when stress testing.
Is there a known solution to this problem?
Thank you very mych for any pointers.
this is script which installs Service:
@echo off
echo.
echo Installing JBoss as service on Windows NT/2K/XP
echo -----------------------------------------------
echo.
if [%1] == [] goto help
if [%2] == [] goto help
if [%Java_Home%] == [] goto help
if [%JBoss_Home%] == [] goto help
echo on
JavaService -install %1 %Java_Home%\jre\bin\server\jvm.dll -Xms1024MB -Xmx1024MB -Djava.class.path=%Java_Home%\lib\tools.jar;%JBoss_Home%\bin\run.jar;%JBoss_Home%\bin\shutdown.jar -start org.jboss.Main -params -c %2 -stop org.jboss.Shutdown -out %JBoss_Home%\server\%2\log\stdout.log -err %JBoss_Home%\server\%2\log\stderr.log -current %JBoss_Home%\bin
@echo off
echo.
echo.
echo The JBoss service can be removed with "JavaService.exe -uninstall %1".
goto end
:help
echo The environment variables %%Java_Home%% and %%JBoss_Home%% have to be set,
echo JavaService.exe and this script have to be in %%JBoss_Home%%\bin.
echo.
echo Parameters:
echo %0 service-name configuration
echo.
echo service-name: name of service (e.g. "JBoss")
echo configuration: configuration of JBoss (e.g. "default", "all" or "minimal")
echo.
echo Java_Home = %Java_Home%
echo JBoss_Home = %JBoss_Home%
echo.
:end
and a bat file when run stand alone:
@echo off
rem -------------------------------------------------------------------------
rem JBoss Bootstrap Script for Win32
rem -------------------------------------------------------------------------
rem $Id: run.bat,v 1.4 2002/03/05 03:00:30 user57 Exp $
@if not "%ECHO%" == "" echo %ECHO%
@if "%OS%" == "Windows_NT" setlocal
set DIRNAME=.\
if "%OS%" == "Windows_NT" set DIRNAME=%~dp0%
set PROGNAME=run.bat
if "%OS%" == "Windows_NT" set PROGNAME=%~nx0%
rem Read all command line arguments
set ARGS=
:loop
if [%1] == [] goto endloop
set ARGS=%ARGS% %1
shift
goto loop
:endloop
rem Find run.jar, or we can't continue
set RUNJAR=%DIRNAME%\run.jar
if exist "%RUNJAR%" goto FOUND_RUN_JAR
echo Could not locate %RUNJAR%. Please check that you are in the
echo bin directory when running this script.
goto END
:FOUND_RUN_JAR
if not "%JAVA_HOME%" == "" goto ADD_TOOLS
set JAVA=java
echo JAVA_HOME is not set. Unexpected results may occur.
echo Set JAVA_HOME to the directory of your local JDK to avoid this message.
goto SKIP_TOOLS
:ADD_TOOLS
set JAVA=%JAVA_HOME%\bin\java
if exist "%JAVA_HOME%\lib\tools.jar" goto SKIP_TOOLS
echo Could not locate %JAVA_HOME%\lib\tools.jar. Unexpected results may occur.
echo Make sure that JAVA_HOME points to a JDK and not a JRE.
:SKIP_TOOLS
rem Include the JDK javac compiler for JSP pages. The default is for a Sun JDK
rem compatible distribution to which JAVA_HOME points
set JAVAC_JAR=%JAVA_HOME%\lib\tools.jar
set JBOSS_CLASSPATH=%JBOSS_CLASSPATH%;%JAVAC_JAR%;%RUNJAR%
rem Setup JBoss sepecific properties
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME%
set JBOSS_HOME=%DIRNAME%\..
rem JPDA options. Uncomment and modify as appropriate to enable remote debugging.
rem set JAVA_OPTS=-classic -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y %JAVA_OPTS%
echo ===============================================================================
echo .
echo JBoss Bootstrap Environment
echo .
echo JBOSS_HOME: %JBOSS_HOME%
echo .
echo JAVA: %JAVA%
echo .
echo JAVA_OPTS: %JAVA_OPTS%
echo .
echo CLASSPATH: %JBOSS_CLASSPATH%
echo .
echo ===============================================================================
echo .
echo %JAVA_OPTS%
echo "%JBOSS_CLASSPATH%"
ECHO .
%JAVA% %JAVA_OPTS% -classpath "%JBOSS_CLASSPATH%" -Xms128MB -Xmx128MB org.jboss.Main %ARGS%
:END
if "%NOPAUSE%" == "" pause