windows服务器下tomcat的常见问题

1、如何将日志打印到catalina.out中?

方法:

修改startup.bat

将call "%EXECUTABLE%" start %CMD_LINE_ARGS%修改为call "%EXECUTABLE%" run %CMD_LINE_ARGS%

修改catalina.bat

将最下面的

%ACTION% 

后面均添加上 >>%CATALINA_BASE%\logs\catalina.out

修改后的样子:

rem Execute Java with the applicable properties
if not "%JPDA%" == "" goto doJpda
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurity
%_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% >>%CATALINA_BASE%\logs\catalina.out
goto end
:doSecurity
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% >>%CATALINA_BASE%\logs\catalina.out
goto end
:doJpda
if not "%SECURITY_POLICY_FILE%" == "" goto doSecurityJpda
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_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% >>%CATALINA_BASE%\logs\catalina.out
goto end
:doSecurityJpda
%_EXECJAVA% %JAVA_OPTS% %CATALINA_OPTS% %JPDA_OPTS% %DEBUG_OPTS% -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -classpath "%CLASSPATH%" -Djava.security.manager -Djava.security.policy=="%SECURITY_POLICY_FILE%" -Dcatalina.base="%CATALINA_BASE%" -Dcatalina.home="%CATALINA_HOME%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" %MAINCLASS% %CMD_LINE_ARGS% %ACTION% >>%CATALINA_BASE%\logs\catalina.out
goto end

:end

2、java.net.SocketTimeoutException 上传文件时的异常

原因是容器的上传时间超时了,可以修改conf/server.xml来修改,比如 我的配置参数为:

               connectionTimeout="20000" maxThreads="1000" minSpareThreads="100" maxSpareThreads="300" acceptCount="1000" redirectPort="8443" disableUploadTimeout="true" enableLookups="false"  />

主要参数是:disableUploadTimeout和connectionTimeout

 

 

你可能感兴趣的:(java,jsp)