解决java.net.SocketTimeoutException: Read timed out

1:在debugger的时候过久会出现该现象,或者读写过大的文件的时候

在tomcat中修改server.xml,增加 disableUploadTimeout=“false”,取消读写连接超时设置

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000" disableUploadTimeout="false"
               redirectPort="8443" URIEncoding="UTF-8"/>

或者增加keepAliveTimeout=“100000”,增大连接生存时间

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000" 
               keepAliveTimeout="100000"
               redirectPort="8443" URIEncoding="UTF-8"/>

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