Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect TimeoutException #13

Open
cool-little-fish opened this issue Sep 27, 2018 · 7 comments
Open

Connect TimeoutException #13

cool-little-fish opened this issue Sep 27, 2018 · 7 comments

Comments

@cool-little-fish
Copy link

前几天还刷着好好的,然后现在好像不行了...碰到了下面的问题....

2018-09-27 09:17:58.000 INFO 16204 --- [TaskScheduler-1] c.yeauty.service.impl.ReaperServiceImpl : 开始进行第 5 次检测
2018-09-27 09:18:08.004 INFO 16204 --- [TaskScheduler-1] o.apache.http.impl.execchain.RetryExec : I/O exception (org.apache.http.conn.ConnectTimeoutException) caught when processing request to {}->http://api.12306.com:80: Connect to api.12306.com:80 [api.12306.com/120.25.132.51] failed: connect timed out
2018-09-27 09:18:08.005 INFO 16204 --- [TaskScheduler-1] o.apache.http.impl.execchain.RetryExec : Retrying request to {}->http://api.12306.com:80
2018-09-27 09:18:18.009 INFO 16204 --- [TaskScheduler-1] o.apache.http.impl.execchain.RetryExec : I/O exception (org.apache.http.conn.ConnectTimeoutException) caught when processing request to {}->http://api.12306.com:80: Connect to api.12306.com:80 [api.12306.com/120.25.132.51] failed: connect timed out
2018-09-27 09:18:18.009 INFO 16204 --- [TaskScheduler-1] o.apache.http.impl.execchain.RetryExec : Retrying request to {}->http://api.12306.com:80
2018-09-27 09:18:28.010 ERROR 16204 --- [TaskScheduler-1] c.yeauty.service.impl.ReaperServiceImpl : 返回车次信息json数据为空,请看是否被封ip,url:http://api.12306.com/v1/train/trainInfos?arrStationCode=null&deptDate=2018-10-06&deptStationCode=null&findGD=false
2018-09-27 09:18:28.010 ERROR 16204 --- [TaskScheduler-1] c.yeauty.service.impl.ReaperServiceImpl : 获取列车信息失败,请查看参数 from-station 、 to-station 、 dept-date 是否有误。或 www.12306.com是否封了IP
org.apache.http.conn.ConnectTimeoutException: Connect to api.12306.com:80 [api.12306.com/120.25.132.51] failed: connect timed out
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:151)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at com.yeauty.util.HttpClientUtils.doGet(HttpClientUtils.java:110)
at com.yeauty.util.HttpClientUtils.doGet(HttpClientUtils.java:124)
at com.yeauty.util.HttpClientUtils.doGet(HttpClientUtils.java:132)
at com.yeauty.service.impl.ReaperServiceImpl.getTrainInfosNode(ReaperServiceImpl.java:439)
at com.yeauty.service.impl.ReaperServiceImpl.monitor(ReaperServiceImpl.java:101)
at com.yeauty.component.TaskApplicationRunner$1.run(TaskApplicationRunner.java:46)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:93)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
... 24 more
2018-09-27 09:18:29.000 INFO 16204 --- [Task

@YeautyYE
Copy link
Owner

请问项目是什么时候拉的,9月19号针对服务端那边封IP做了修改,可尝试拉新的代码试试

@WillPanSUTD
Copy link

同样的问题 :(

@YeautyYE
Copy link
Owner

同样的问题 :(

请问你拉的是最新的代码吗

@cool-little-fish
Copy link
Author

是最新的呀,上次我还手动添加了伪装IP的内容....

@YeautyYE
Copy link
Owner

服务端那边换了种封IP的方法,大家先改用其它方法抢票,我先想下如何处理

@WillPanSUTD
Copy link

https://blog.csdn.net/zhengxiongwei/article/details/78486146
这里有个随机生成国内IP的算法,你可以参考一下?

@YeautyYE
Copy link
Owner

https://blog.csdn.net/zhengxiongwei/article/details/78486146
这里有个随机生成国内IP的算法,你可以参考一下?

谢谢。其实问题不在怎么生成IP,而在于他们现在不获取请求头的代理IP,并直接对请求的客户端IP进行封锁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants