Tomcat 6.0.x Installation Issue With Windows Server 2003 x64

Tags:

Today when trying to install Apache Tomcat on a new clean Windows 2003 x64 server I ran into an issue where Tomcat would start fine from the start.bat script at a command prompt, but would fail when trying to start it as a service. Here is the error message that Windows popped up:

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.

Looking in the "jakarta_service" log file, I see the following text:

[2010-04-06 15:08:33] [info] Commons Daemon procrun (1.0.2.0) started
[2010-04-06 15:08:33] [info] Running Service...
[2010-04-06 15:08:33] [info] Starting service...
[2010-04-06 15:08:33] [206 javajni.c] [error] The specified module could not be found.
[2010-04-06 15:08:33] [985 prunsrv.c] [error] Failed creating java
[2010-04-06 15:08:33] [1280 prunsrv.c] [error] ServiceStart returned 1
[2010-04-06 15:08:33] [info] Run service finished.
[2010-04-06 15:08:33] [info] Commons Daemon procrun finished.

Here is my basic server configuration:

Windows Server 2003 R2
Standard x64 Edition
Service Pack 2
Java JRE 6 Update 19 Windows x64
Apache Tomcat 6.0.26 Windows x64 (installed from ZIP file)

I installed the JRE with the standard installer and I extracted tomcat to a directory and ran the "service.bat install" command to install the service.

So, I did a little Googling and found a site where someone used Sysinternals Process Monitor to look at the tomcat6.exe process to see what it was doing. I tried this and found the following:

Sysinternals Process Monitor Screen Shot

It looks as though tomcat6.exe is not able to find the jvm.dll file. So, I look for this file and find that is really doesn't exist at that location. Instead, it is located in "C:\Program Files\Java\jre6\bin\server\jvm.dll". I am not sure why my install of the JRE has a server folder and not a client folder. It could be that when I installed it the installer was smart enough to realize this is a server environment and installed it this way. Regardless, this is what I had.

My "fix" was to open tomcat6w.exe and to set the Java Virtual Machine manually by pointing it to the jvm.dll in the server folder.

tomcat6w.exe screen shot

Now, when I start the Apache Tomcat service it starts without error.