Sunday, April 01, 2007

Creating virtual directory in tomcat is a little different than Apache. All you have to do is add the following lines to your server.xml file under /conf.


<Context path="/folder"
docBase="C:/folder/"
crossContext="false"
debug="0"
reloadable="true" >
</Context>

Setting up Tomcat 6.0 to run with JDK6.0 today. For some reason, Tomcat just wouldn't start. A quick examination on the error log file gives this:


[2007-04-01 12:03:23] [174 javajni.c] [error] The specified module could not be found.
[2007-04-01 12:03:23] [947 prunsrv.c] [error] Failed creating java D:\Program Files\Java\jre1.6.0_01\bin\client\jvm.dll
[2007-04-01 12:03:23] [1202 prunsrv.c] [error] ServiceStart returned 1


I fired up file monitor (courtesy of Sysinternals), restarted tomcat, and clicked Capture. Then I looked at the tomcat.exe section and found that Tomcat attempted to open a file called msvcr71.dll first in its own directory, couldn't find it, and proceeded to look in system32, etc. and failed in all instances. msvcr71 is the C runtime library, you would think it should come with Windows, right? (This file doesn't come with Windows possibly because of the DLL versioning hell so typical of Windows system). Anyway, I did a search for that file and found it in the jdk 6.0 directory. I copied the file to Tomcat's bin folder, restarted Tomcat and everything worked.