This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I had searched the web and done just about everything people suggested from adding practically every file to my CLASSPATH and setting JAVA_HOME as well as CATALINA_HOME (which I still don't know what that is). Nothing helped. Finally it mysteriously started working after I had copied the properties of the default Start Tomcat properties into an MS-DOS prompt window in Windows to see if it was giving any errors since it closes so fast. Looked fine, no problems. I tried to connect to the server again and it worked! Apparently, if you go into Services in Windows 2000 and look for Tomcat, it loads up just Tomcat.exe. Personally, this does not make sense to me... but it took me a while to realize the difference. So come to find out, when I reboot and it default starts up Tomcat.exe through Services, I can't access it again. So I need to go shut that one down and startup the Start Tomcat shortcut. This led me to believe it was the manner Tomcat was being started which was the problem. Just Tomcat.exe and not the whole line from the Start Tomcat shortcut wasn't enough. I modified the Services in the registry for Tomcat to be the same prompt commands that Start Tomcat runs, however, it takes too long and times out (never knew Services had a time limit!). So then I just disabled Tomcat in Services by making it start manually instead of automatically and then added the Start Tomcat shortcut properties to "HKLM->Software->Microsoft->Windows->CurrentVersion->Run". I thought this might startup when the system booted, but it doesn't run until you login. But hey, at least it starts up and works at that point! Better than nothing I guess... too bad if I do a remote restart, I can't sign in so my server won't be up. If anyone knows what I did wrong, that'd be great for it to work the defaulted way and start at startup. However, this is a possible work around. The plain Tomcat.exe works fine on an NT machine here at work with JDK 1.4.1_01... too bad this isn't where I need it.
We have had exactly the same problem, for some reason tomcat won't start right when run as service. We found a workaround by using a custom made service created with srvstart: http://www.nick.rozanski.com/services.htm It doesn't always work (especialy stopping the service sometimes fails). But it is much better then having to log in to get tomcat started. Our srvstart control file looks something like this: ------------------------------ startup=C:\j2sdk1.4.0\bin\java -server -Xms32m -Xmx256m -Dlog4j.configuration=file:///C:/ApacheTomcat/conf/log4j.properties -Djava.endorsed.dirs="C:\ApacheTomcat\bin;C:\ApacheTomcat\common\lib" -classpath "C:\j2sdk1.4.0\lib\tools.jar;C:\ApacheTomcat\bin\bootstrap.jar" -Dcatalina.base="C:\ApacheTomcat" -Dcatalina.home="C:\ApacheTomcat" -Djava.io.tmpdir="C:\TEMP" org.apache.catalina.startup.Bootstrap start startup_dir=C:\ApacheTomcat\bin\ shutdown_method=command shutdown=C:\j2sdk1.4.0\bin\java.exe -jar "C:\ApacheTomcat\bin\bootstrap.jar" stop ------------------------------ As you can see we just copied the final command that is executed by the tomcat startup.bat file. Plus some of our own extra's (-server -Xms32m -Xmx256m -D etc.) Hope this helps [ December 10, 2002: Message edited by: Nico Krijnen ]