在heroku中部署scraper并获取java.net.sockettimeoutexception:read超时

3bygqnnd  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(245)

我编写了一个快速应用程序,可以转到url并检查一些信息它在本地运行得非常好,但当我部署到heroku时,它会引发以下异常:
p、 s:我在用htmlunit

021-02-15T04:47:07.740845+00:00 app[web.1]: java.net.SocketTimeoutException: Read timed out
2021-02-15T04:47:07.741156+00:00 app[web.1]:    at java.net.SocketInputStream.socketRead0(Native Method)
2021-02-15T04:47:07.741208+00:00 app[web.1]:    at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
2021-02-15T04:47:07.741246+00:00 app[web.1]:    at java.net.SocketInputStream.read(SocketInputStream.java:171)
2021-02-15T04:47:07.741285+00:00 app[web.1]:    at java.net.SocketInputStream.read(SocketInputStream.java:141)
2021-02-15T04:47:07.741326+00:00 app[web.1]:    at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137)
2021-02-15T04:47:07.741398+00:00 app[web.1]:    at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153)
2021-02-15T04:47:07.741458+00:00 app[web.1]:    at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:280)
2021-02-15T04:47:07.741522+00:00 app[web.1]:    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138)
2021-02-15T04:47:07.741591+00:00 app[web.1]:    at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
2021-02-15T04:47:07.741650+00:00 app[web.1]:    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)
2021-02-15T04:47:07.741717+00:00 app[web.1]:    at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163)
2021-02-15T04:47:07.741758+00:00 app[web.1]:    at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:157)
2021-02-15T04:47:07.741802+00:00 app[web.1]:    at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273)
2021-02-15T04:47:07.741845+00:00 app[web.1]:    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
2021-02-15T04:47:07.741885+00:00 app[web.1]:    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272)
2021-02-15T04:47:07.741914+00:00 app[web.1]:    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:186)
2021-02-15T04:47:07.741949+00:00 app[web.1]:    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
2021-02-15T04:47:07.741993+00:00 app[web.1]:    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
2021-02-15T04:47:07.742026+00:00 app[web.1]:    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
2021-02-15T04:47:07.742064+00:00 app[web.1]:    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
2021-02-15T04:47:07.742107+00:00 app[web.1]:    at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:192)
2021-02-15T04:47:07.742149+00:00 app[web.1]:    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1545)
2021-02-15T04:47:07.742190+00:00 app[web.1]:    at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1468)
2021-02-15T04:47:07.742228+00:00 app[web.1]:    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:462)
2021-02-15T04:47:07.742266+00:00 app[web.1]:    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:382)
2021-02-15T04:47:07.742303+00:00 app[web.1]:    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:539)
2021-02-15T04:47:07.742358+00:00 app[web.1]:    at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:520)

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题