Apache Tomcat 7.0.40 disappears after 1 second
Asked Answered
P

6

18

I downloaded apache-tomcat-7.0.40 for Windows 8 and I followed the instructions by using the C:\apache-tomcat-7.0.40> startup.bat at my command prompt. The tomcat application appeared for 1 second and then disappeared, so I maybe the documents installation is not enough? What should I do? While my local host is internet information service.

Pisciform answered 31/5, 2013 at 7:18 Comment(3)
Open a terminal / command prompt, go to the directory and then run startup.bat. Check if you see any errors. You can also check the catalina.out file under the logs folder. My guess is that you don't have the current version of JDK installed or JAVA_HOME env variable is not set properly.Galvanometer
Bat file complete its task and cmd window close then. To see what it says either open command propmt in this folder and run up.bat from it or redirect .bat output to text file up.bat > out.txtRealism
Try right-clicking and "run as administrator", solved it for meJalap
S
33

In command prompt run below command, you will get the root cause.

...\apache-tomcat-7.0.42\bin> catalina.bat run
Symphonic answered 17/7, 2015 at 11:38 Comment(0)
P
12

In my case it was because I run catalina.bat start and this command creates new command prompt, while catalina.bat run executes in the same command prompt and doesn't close it after finishing.

Picofarad answered 19/1, 2017 at 16:34 Comment(0)
F
4

Try to remove the slash at the end of CATALINA_HOME variable path.

Fieldwork answered 6/5, 2014 at 13:57 Comment(0)
S
3

Catalina needs JAVA_HOME to work properly. So configure path to java jre and JAVA_HOME in environment variables.

To see the error, in command prompt execute

\path\apache-tomcat-6.0.41\bin > catalina.bat run
Smukler answered 23/8, 2016 at 8:15 Comment(0)
P
1

Go to your tomcat/bin folder. Edit startup.bat file, comment out last but one line which says:

call "%EXECUTABLE%" run >..\logs\OutputFile.log 2>&1 start %CMD_LINE_ARGS% run >..\logs\OutputFile.log 2>&1

comment out using 'rem' beginning of it.

rem call "%EXECUTABLE%" run >..\logs\OutputFile.log 2>&1 start %CMD_LINE_ARGS% run >..\logs\OutputFile.log 2>&1 

then Console will be remain open. if this line is commented then that means it says to close the console and write the output in some external log file.

Pagan answered 6/3, 2019 at 21:9 Comment(0)
S
0

Your problem is, most likely, wrong path of the CATALINA_HOME environment variable.

Answers above would help, but I will add one point, which would be more extensive as it may help for different kind of exceptions connected to server startup, and namely - to CATALINA_HOME.

In the late versions of Tomcat, You actually do not need to set environment variable CATALINA_HOME. If you'll have a look inside start startup.bat, the script sets it itself upon each execution.

[23-30] lines of the script in Tomcat 9:

rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set "CATALINA_HOME=%cd%"
cd "%CURRENT_DIR%"

So, just to be safe that your environment variable doesn't mess up with something defined by Tomcat script startup.bat (or anything else), you can either:

  1. Remove your CATALINA_HOME environment variable entirely, as long as you start your server with startup.bat;
  2. Correct your environment variable CATALINA_HOME path if you insist to be starting it otherwise, and make sure, nothing overrides it during run-time.
Sepoy answered 17/3, 2019 at 10:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.