Can't start Tomcat as Windows Service

115,549

Solution 1

Go to Start > Configure Tomcat >

  • Startup > Mode = Java
  • Shutdown > Mode = Java

This worked for me!

Solution 2

I have the problem because I updated Java version.

The following steps work for me:

  1. Run \Tomcat\bin\tomcat7w.exe
  2. Confirm "Startup" tab -> "Mode" choose "jvm"
  3. "Java" tab -> update "Java Virtual Machine" path to new version path
  4. Restart Tomcat

Done.

Solution 3

"Windows could not start the Apache Tomcat 6 on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 0"

When an error of this sort come. please go to start -> configure tomcat -> startup -> Mode -> java similarly start -> configure tomcat -> shutdown -> Mode -> java

Solution 4

You need to check the ports first. It might be situation that default port(8080) is used by some other application.

Try changing the port from 8080 to some different port in conf/server.xml file.

Also please check that your JRE_HOME variable is set correctly because tomcat needs JRE to run. You can also set your JRE_HOME variable in system. For that go to my computer->right click and select properties->Advanced system settings->Advanced->Environment variable and click on new-> variable name = "JRE_HOME" and variable value = "C:\Program Files\Java\jre7"

Solution 5

  1. Check the apache tomcat catalina log: ../logs/catalina.log
  2. If in the log you find the "port was used" exception, then Check windows used ports and processes with following command: Run cmd netstat -ao it will list all listening ports and corresponding process Id, you can find the port which was used by Tomcat from the configuration file: ../conf/server.xml

    <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />
    

and kill the process which use the tomcat port

Share:
115,549
melo
Author by

melo

Updated on May 24, 2021

Comments

  • melo
    melo almost 3 years

    I am using Tomcat6 on Windows 8. I am able to start Tomcat via startup.bat without error. I've copied Tomcat6.exe, Tomcat6w.exe and service.bat under tomcat/bin directory and set the .exe files to run as administrator.

    I open command line with administrator rights and execute "service.bat install" which ran without error. In Windows Services, I can see Apache Tomcat 6 which I want to run automatically.

    But both running from Windows Services using "Start" button and on start up of Windows I got the same error.

    "Windows could not start the Apache Tomcat 6 on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 0.

    When I check Windows Event Log, I see the following bizarre error.

    "Apache Tomcat 6 service terminated with the following service-specific error: The operation completed successfully."

    I tried copying msvcr71.dll under tomcat/bin directory, but nothing changed. What else can I do?

    Update:

    I am using a different port than 8080. And I saw the error below in the log file /logs/jakarta_service.log:

    %1 is not a valid Win32 application.

  • Andronicus
    Andronicus over 4 years
    This is a duplicated answer, please provide your own or delete the post
  • schattenjager
    schattenjager almost 4 years
    2020 and it just happened to me with Tomcat 9.3. TomcatXw is located (Win 10) in C:\Program Files\Apache Software Foundation\Tomcat 9.0\bin. Changed mode from "jvm" to "java" and problem was solved. THANKS!
  • Rushikesh Gaidhani
    Rushikesh Gaidhani over 2 years
    In layman terms, - Go to bin folder of your tomcat installed/extracted path (example, C:\tomcat\bin) - run the program Tomcat8w (it will open tomcat properties GUI) - switch to Startup tab and set Mode = Java - select Shutdown tab and set Mode = Java - Start/Restart Tomcat windows service