I am inheriting a project and (per the other developer’s instructions) overwrote my Tomcat’s version of catalina.bat with his (he’s using the same version). I then tried to restart Tomcat and got an exception relating to the commons-logging.jar, which is a Tomcat dependency.
After a lot of frustration, I just downloaded a different version of Tomcat and tried running it right out of the box (no configuration)…and I got the same error!
So I asked this question on SO a few days ago. The consensus was that my classpath had somehow gotten “dirty”, and now I’m wondering if the catalina.bat file I blindly copied over somehow set environmental variables that is affecting Tomcat’s ability to bootstrap – even across versions.
I know this question is similar to the other one I asked but is different. Whereas my first question was “what’s wrong here” and was much more general, what I am asking now (although related), is more specific and is about catalina.bat and how it relates to Windows 7 environment variables.
Thanks for any help here.
Edit: I see this question already has a closevote for being “off topic”. My argument against that is as follows: SO is a programming Q&A site for asking specific questions related to code and programming. catalina.bat is a script, which is code, and this question concerns itself with a potential bug/defect in a script that I am using.
Edit: Found the line in catalina.bat where the error message is coming from (and, likewise, where Tomcat startup is dying from). It’s is line (from 7.0.19’s unchanged version):
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs=”%JAVA_ENDORSED_DIRS%” -classpath “%CLASSPATH%” -Dcatalina.base=”%CATALINA_BASE%” -Dcatalina.home=”%CATALINA_HOME%” -Djava.io.tmpdir=”%CATALINA_TMPDIR%” %MAINCLASS% %CMD_LINE_ARGS% %ACTION%
I was able to place echos in the script and obtained the following values:
JAVA_OPTS = -Djava.util.logging.config.file="C:\Program Files\Apache\apache-to
mcat-7.0.19\conf\logging.properties" -Djava.util.logging.manager=org.apache.juli
.ClassLoaderLogManager
CATALINA_OPTS =
DEBUG_OPTS =
JAVA_ENDORSED_DIRS = C:\Program Files\Apache\apache-tomcat-7.0.19\endorsed
CLASSPATH = C:\Program Files\Apache\apache-tomcat-7.0.19\bin\bootstrap.jar
CATALINA_BASE = C:\Program Files\Apache\apache-tomcat-7.0.19
CATALINA_HOME = C:\Program Files\Apache\apache-tomcat-7.0.19
CATALINA_TMPDIR = C:\Program Files\Apache\apache-tomcat-7.0.19\temp
MAINCLASS is org.apache.catalina.startup.Bootstrap
CMD_LINE_ARGS =
ACTION = start
JAVA_OPTS has my full attention with the logging.properties and ClassLoaderLogManager entries. Does this mean anything to anyone?!?
you can set the environment variables in any batch file, including catalina.bat. But these changes stay only in the current running environment and will not affect all the other running environments.
For CLASSPATH, look in the corresponding batch files if you see something like
set CLASSPATH=which give you information about the classpath being set.