Running Apache Tomcat as an NT service with JRockit JRE/JVM

I've found a thread about the problem, but no solution there. With a little help from Sysinternal's Process Monitor I could find out that the Tomcat installer misses the client subdirectory in the JRE\bin dir and the jvm.dll file inside that dir. In case of Sun's JRE the bin dir indeed contains a client\jvm.dll, but in case of JRockit that dir is called jrockit. Thus you can work around the issue by renaming the jrockit directory inside JRE/bin, do the install, then rename it back. However if you intend to keep the original name, then after the installation you've to alter the JVM path in the Tomcat configuration (the little app. sitting in the system tray) too to match the real JVM path.

One another problem: after installing Tomcat the service won't start. Not even after a reboot. The solution is to include the path of the JRE\bin directory in the system PATH environment variable (Start Menu / Settings / Control Panel / System / Advanced / Environment variables). After changing the PATH, you've to reboot for it to take full effect (services will see the change only after a reboot).

Now your Tomcat service should start with JRockit.

PS: by default if you run Tomcat as an NT service, it won't be listed in Mission Control's "Discovered" tree. If you run Tomcat from the command line (you've to use the *.tar.gz Tomcat bundle for that since the NT installer does not copy any of the shell scripts to Tomcat's bin subdirectory that are needed for starting from the command line), then Tomcat's JVM will be autodiscovered by Mission Control and you can start profiling, debugging, etc.

If you want to use Mission Control with a Tomcat running as an NT service, then you've to use the JMX connection method. That means you've to add the following Java option in Tomcat service configuration:
-Xmanagement:ssl=false,authenticate=false,port=7091,autodiscovery=true

Start (or restart) the Tomcat service and after the server started up (eg. the CPU usage went down or you see the "INFO: Server startup in 16047 ms" message in catalina.YYYY-MM-DD.log) start Mission Control. Create a new connection under "Connectors", add host as localhost (or the hostname of the Tomcat server) and port 7091 (or what you used in the -Xmanagement Java option. Now you should be able to launch Memleak, Console or whatever in Mission Control for the new connection.