why is my tomcat console dying just after starting up?
Accepted answer
the script used to start the CLM server, server.startup.bat will call a tomcat script startup.bat that will itself call catalina.bat.
you can start catalina.bat with different option, the default is set to start in startup.bat which will open the console in a new window.
the details of the options are given in catalina.bat:
echo debug Start Catalina in a debugger
echo debug -security Debug Catalina with a security manager
echo jpda start Start Catalina under JPDA debugger
echo run Start Catalina in the current window
echo run -security Start in the current window with security manager
echo start Start Catalina in a separate window
echo start -security Start in a separate window with security manager
echo stop Stop Catalina
echo configtest Run a basic syntax check on server.xml
echo version What version of tomcat are you running?
so edit startup.bat to use the "run" option and next time you start server.startup.bat in the server directory, tomcat will start in the same window.
change:
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
to
call "%EXECUTABLE%" run %CMD_LINE_ARGS%
you would then be able to see error such as:
JVMJ9VM015W Initialization error for library j9gc24(5): Failed to allocate default memory space
Could not create theJava virtual machine
you can start catalina.bat with different option, the default is set to start in startup.bat which will open the console in a new window.
the details of the options are given in catalina.bat:
echo debug Start Catalina in a debugger
echo debug -security Debug Catalina with a security manager
echo jpda start Start Catalina under JPDA debugger
echo run Start Catalina in the current window
echo run -security Start in the current window with security manager
echo start Start Catalina in a separate window
echo start -security Start in a separate window with security manager
echo stop Stop Catalina
echo configtest Run a basic syntax check on server.xml
echo version What version of tomcat are you running?
so edit startup.bat to use the "run" option and next time you start server.startup.bat in the server directory, tomcat will start in the same window.
change:
call "%EXECUTABLE%" start %CMD_LINE_ARGS%
to
call "%EXECUTABLE%" run %CMD_LINE_ARGS%
you would then be able to see error such as:
JVMJ9VM015W Initialization error for library j9gc24(5): Failed to allocate default memory space
Could not create theJava virtual machine
Comments
In all the cases that I've seen with this symptom the problem is memory like the error message reports. To resolve the issue make sure the system meets the memory requirements. But as a workaround to get the server running until memory is acquired, lower the -xmx value in server.startup.bat. The default value is 4000 M.
While speaking of JVM, only a 64-bit JRE will allow that size for JVM parameters. I think 32bit max is 2048.
Nifty trick. I usually just run server.startup from the command-line to see the error.
Actually, I take that back. I just ran into this problem and I see that even running server.startup on the command-line can end up in a window appearing and immediately disappearing. Thanks for the tip!
One other answer
The recommended action for startup problems is to run server.startup.bat in debug mode.
C:\IBM\JazzTeamServer\server>server.startup.bat -debug
This still does not show anything because the debug section of server.startup.bat is wrong.
Change the debug section of server.startup.bat from
if ""%1"" == ""-debug"" (
call "%CATALINA_HOME%"\bin\catalina.bat jpda start
to
if ""%1"" == ""-debug"" (
call "%CATALINA_HOME%"\bin\catalina.bat jpda run
Now you will see why your server does not start.
My server says:
C:\IBM\JazzTeamServer\server>server.startup.bat -debug
Using CATALINA_BASE: "C:\IBM\JazzTeamServer\server\tomcat"
Using CATALINA_HOME: "C:\IBM\JazzTeamServer\server\tomcat"
Using CATALINA_TMPDIR: "C:\IBM\JazzTeamServer\server\tomcat\temp"
Using JRE_HOME: "C:\IBM\JazzTeamServer\server\jre"
Using CLASSPATH: "C:\IBM\JazzTeamServer\server\tomcat\bin\bootstrap.jar;C:
\IBM\JazzTeamServer\server\tomcat\bin\tomcat-juli.jar"
JVMJ9VM015W Initialization error for library j9gc24(5): Failed to allocate default memory space
Could not create the Java virtual machine.
C:\IBM\JazzTeamServer\server>server.startup.bat -debug
This still does not show anything because the debug section of server.startup.bat is wrong.
Change the debug section of server.startup.bat from
if ""%1"" == ""-debug"" (
call "%CATALINA_HOME%"\bin\catalina.bat jpda start
to
if ""%1"" == ""-debug"" (
call "%CATALINA_HOME%"\bin\catalina.bat jpda run
Now you will see why your server does not start.
My server says:
C:\IBM\JazzTeamServer\server>server.startup.bat -debug
Using CATALINA_BASE: "C:\IBM\JazzTeamServer\server\tomcat"
Using CATALINA_HOME: "C:\IBM\JazzTeamServer\server\tomcat"
Using CATALINA_TMPDIR: "C:\IBM\JazzTeamServer\server\tomcat\temp"
Using JRE_HOME: "C:\IBM\JazzTeamServer\server\jre"
Using CLASSPATH: "C:\IBM\JazzTeamServer\server\tomcat\bin\bootstrap.jar;C:
\IBM\JazzTeamServer\server\tomcat\bin\tomcat-juli.jar"
JVMJ9VM015W Initialization error for library j9gc24(5): Failed to allocate default memory space
Could not create the Java virtual machine.
Comments
Princi Verma
Nov 11 '17, 5:36 p.m.Hi,
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Nov 18 '16, 8:27 a.m.