站长资讯网
最全最丰富的资讯网站

windows服务器下tomcat的常见问题

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

方法:

修改startup.bat

将call “%EXECUTABLE%” start %CMD_LINE_ARGS%修改为call “%EXECUTABLE%” run %CMD_LINE_ARGS%

修改catalina.bat

将最下面的

%ACTION%

后面均添加上>>%CATALINA_BASE%logscatalina.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%logscatalina.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%logscatalina.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%logscatalina.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%logscatalina.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

赞(0)
分享到: 更多 (0)
网站地图   沪ICP备18035694号-2    沪公网安备31011702889846号