Reputation: 239
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.
Upvotes: 19
Views: 164279
Reputation: 318
I solved this problem setting the correct JVM
path inside the tomcatXw.exe
tomcatXw.exe
Java
tabuse default
and be sure that your Java Virtual Machine
is set to the correct path. For more informations check out this
Upvotes: 0
Reputation: 127
Well before going so far, first make sure that you have the path to the Java directory in your Windows Environment Path
C:\Program Files\Java\jdk-13.0.2
bin
' folder and start it up.Supposed to work now.
Upvotes: -1
Reputation: 11
Solution suggested by Prashant worked fine for me.
Tomcat9 Properties > Configure > Startup > Mode = Java Tomcat9 Properties > Configure > Shutdown > Mode = Java
Upvotes: 1
Reputation: 3
On a 64-bit system you have to make sure that both the Tomcat application and the JDK are the same architecture: either both are x86 or x64.
In case you want to change the Tomcat instance to x64 you might have to download the tomcat8.exe
or tomcat9.exe
and the tcnative-1.dll
with the appropriate x64 versions. You can get those at http://svn.apache.org/viewvc/tomcat/.
Alternatively you can point Tomcat to the x86 JDK by changing the Java Virtual Machine path in the Tomcat config.
Upvotes: 0
Reputation: 165
It is very important that you don't include bin in your JAVA_HOME path. It should be like,
C:\Program Files\Java\jdk-11.0.3
Upvotes: 1
Reputation: 11
The simplest answer that worked for me was the one mentioned by Prashant, and edited by Bluish.
Go to Start > Configure Tomcat > Startup > Mode = Java Shutdown > Mode = Java
Unfortunately I had(and possibly others) to do this in a different way, I went to the tomcat bin directory and ran the "tomcat7w" application, which is how I changed the configuration.
There I was able to change the startup mode and shutdown mode to Java. Like this:
Step1) Locate tomcat7w:
general location => %TomCatHomeDIR%/bin In my case tomcat was in the xampp folder so my address was:
C:\xampp\tomcat\bin
tomcat7w file location screenshot
Step2) Launch tomcat7w && change the Mode in the Startup and Shutdown tabs
tomcat7w startup tab screenshot
Note >This based on version 7.0.22 that comes standard with XAMPP.
Upvotes: 1
Reputation: 641
Go to Start > Configure Tomcat >
This worked for me!
Upvotes: 49
Reputation: 928
All those mistakes are related to badly connected Apache and JDK.
people usually forget to setup JAVA_HOME in System variables.
if you still have an error try to think step by step
Upvotes: 0
Reputation: 11949
Cause :
This issue is caused:
1- tomcat can't find the jvm file from the directory specified to start the service because is deleted.
2- Incorrect permissions to the java folder for read&write access
3- Incorrect JAVA_HOME path.
4- Antivirus deleted the jvm file from java folder
Resolution:
1- confirm that especified file exisit in the java directoy.
2- Make sure that file has read&write permissions.
3- Confirm that JAVA_HOME is correct for java version.
4- if file has been deleted reinstall same java version to recreate missing files.
Upvotes: 1
Reputation: 671
In my case it helps if you don't install the x86 version over the x64 version... DOH!!!
Upvotes: -1
Reputation: 568
I have the problem because I updated Java version.
The following steps work for me:
- Run
\Tomcat\bin\tomcat7w.exe
- Confirm "Startup" tab -> "Mode" choose "jvm"
- "Java" tab -> update "Java Virtual Machine" path to new version path
- Restart Tomcat
Done.
Upvotes: 16
Reputation: 1
I had the similar issue, But installing tomcat 32bit and jdk 32 bit worked, This happens mostly because of mismatch Bit.
Upvotes: 0
Reputation: 91
"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
Upvotes: 9
Reputation: 293
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
Upvotes: 1
Reputation: 366
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"
Upvotes: 3