My tomcat server is working fine in Eclipse but when I try to start the server it is not starting.
Here are the errors:
[2012-08-15 09:26:09] [info] Procrun (2.0.5.0) started
[2012-08-15 09:26:09] [info] Running Service...
[2012-08-15 09:26:09] [info] Starting service...
[2012-08-15 09:26:09] [197 javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:26:09] [994 prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:26:09] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:26:09] [info] Run service finished.
[2012-08-15 09:26:09] [info] Procrun finished.
[2012-08-15 09:29:06] [info] Procrun (2.0.5.0) started
[2012-08-15 09:29:06] [info] Running Service...
[2012-08-15 09:29:06] [info] Starting service...
[2012-08-15 09:29:06] [197 javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:29:06] [994 prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:29:06] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:29:06] [info] Run service finished.
[2012-08-15 09:29:06] [info] Procrun finished.
[2012-08-15 09:30:07] [info] Procrun (2.0.5.0) started
[2012-08-15 09:30:07] [info] Running Service...
[2012-08-15 09:30:07] [info] Starting service...
[2012-08-15 09:30:07] [197 javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:30:07] [994 prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:30:07] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:30:07] [info] Run service finished.
[2012-08-15 09:30:07] [info] Procrun finished.
[2012-08-15 09:30:57] [info] Procrun (2.0.5.0) started
[2012-08-15 09:30:57] [info] Running Service...
[2012-08-15 09:30:57] [info] Starting service...
[2012-08-15 09:30:57] [197 javajni.c] [error] %1 is not a valid Win32 application.
[2012-08-15 09:30:57] [994 prunsrv.c] [error] Failed creating java C:\java\java\jre\bin\server\jvm.dll
[2012-08-15 09:30:57] [1269 prunsrv.c] [error] ServiceStart returned 1
[2012-08-15 09:30:57] [info] Run service finished.
[2012-08-15 09:30:57] [info] Procrun finished.
What does these errors mean and how do I fix them?
解决方案
I had the exact same problem and it was caused by running a 32 bits Tomcat on a 64 bits windows. (I was using XAMPP 1.8.3 in a Windows 8 64 bits.)
First:
Make sure you have JAVA_HOME system variable pointing to your jdk folder (not the \bin);
Make sure %JAVA_HOME%\bin; is in your %PATH% system variable.
The solution:
Uninstall the Tomcat7 service if you have installed it already;
Download a 64 bit version of Tomcat 7 for windows (check this link to get the latest - I used the 7.0.42 version);
Replace the tomcat7.exe and tomcat7w.exe files of the C:\xampp\tomcat\bin folder with those present in the recently downloaded zip file.
Now you can install the service as usual (through XAMPP control panel, if you use it) and it should start just fine.