关于昨天定时器不执行的问题?

今天特意看了下日志和控制台输出,确实是天气API接口出现故障,错误代码如下:

[INFO]-[Thread: cron4j::scheduler[b50e3a4b002047ca0124bed400000158dc78b256250c6903]::executor[b50e3a4b002047ca01e5db3900000158e0e1202116c443dc]]-[com.
css.swj.Task.run()]: 开始执行......
java.net.ConnectException: Connection timed out: connect
        at java.net.DualStackPlainSocketImpl.connect0(Native Method)
        at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:203)
        at sun.net.www.http.HttpClient.New(HttpClient.java:290)
        at sun.net.www.http.HttpClient.New(HttpClient.java:306)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:995)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
        at com.css.swj.Task.request(Task.java:79)
        at com.css.swj.Task.run(Task.java:40)
        at it.sauronsoftware.cron4j.RunnableTask.execute(Unknown Source)
        at it.sauronsoftware.cron4j.TaskExecutor$Runner.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:722)
java.lang.NullPointerException
        at com.css.swj.Task.run(Task.java:42)
        at it.sauronsoftware.cron4j.RunnableTask.execute(Unknown Source)
        at it.sauronsoftware.cron4j.TaskExecutor$Runner.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:722)

有什么免费稳定点的接口?或者在没采到数据在重新采一次?

评论区

JFinal

2016-12-09 09:45

Connection timed out,对方 api 不稳定而已,找个靠谱的 api 用上即可打完收枪

JFinal

2016-12-09 09:46

感谢回来分享

matol

2016-12-19 15:48

没有什么aip接口是靠谱的,这一类的最好去阿里云购买api产品服务

热门分享

扫码入社