1.先看看錯(cuò)誤日志
2019-01-11 09:21:32,242 INFO [pool-3-thread-1] com.ejavashop.core.sms.xfbsms.utils.LoggerUtil.info(45) -- Fri Jan 11 09:21:32 CST 2019 sendTemplateSMS url = https://sandboxapp.cloopen.com:8883/2013-12-26/Accounts/aaf98f8952f7367a01530c5dd33626c6/SMS/TemplateSMS?sig=7939BE20B60257805AF0B6A99B28ED38
?2019-01-11 09:21:32,243 INFO [pool-3-thread-1] com.ejavashop.core.sms.xfbsms.utils.LoggerUtil.info(45) -- Fri Jan 11 09:21:32 CST 2019 sendTemplateSMS Request body =? {"appId":"8aaf07085e0e36d0015e279952c20746","to":"13152541141","templateId":"259015","datas":["您好耘纱,您已成功注冊,您的驗(yàn)證碼是613957【廣東禧越科技】","10"]}
?2019-01-11 09:21:32,243 DEBUG [pool-3-thread-1] org.apache.http.impl.conn.BasicClientConnectionManager.getConnection(160) -- Get connection for route {s}->https://sandboxapp.cloopen.com:8883
?2019-01-11 09:21:32,278 DEBUG [pool-3-thread-1] org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(174) -- Connecting to sandboxapp.cloopen.com:8883
2019-01-11 09:21:47,870 DEBUG [Timer-0] org.apache.http.impl.conn.LoggingManagedHttpClientConnection.shutdown(87) -- http-outgoing-85: Shutdown connection
?2019-01-11 09:21:47,871 DEBUG [Timer-0] org.apache.http.impl.execchain.ConnectionHolder.abortConnection(128) -- Connection discarded
?2019-01-11 09:21:47,871 DEBUG [Timer-0] org.apache.http.impl.conn.LoggingManagedHttpClientConnection.close(79) -- http-outgoing-85: Close connection
?2019-01-11 09:21:47,871 DEBUG [Timer-0] org.apache.http.impl.conn.PoolingHttpClientConnectionManager.releaseConnection(320) -- Connection released: [id: 85][route: {}->http://183.232.34.84:8080][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
?org.apache.http.conn.ConnectTimeoutException: Connect to 183.232.34.84:8080 [/183.232.34.84] failed: Connection timed out
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:149)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at com.ejavashop.core.HttpClientUtil.sendGet(HttpClientUtil.java:36)
at com.ejavashop.web.job.IndexCacheTimerTask.run(IndexCacheTimerTask.java:40)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
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.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
... 13 more
2019-01-11 09:21:47,871 DEBUG [Timer-0] org.apache.http.impl.conn.PoolingHttpClientConnectionManager.shutdown(388) -- Connection manager is shutting down
?2019-01-11 09:21:47,872 DEBUG [Timer-0] org.apache.http.impl.conn.PoolingHttpClientConnectionManager.shutdown(394) -- Connection manager shut down
?2019-01-11 09:21:47,872 INFO [Timer-0] com.ejavashop.web.job.IndexCacheTimerTask.run(46) -- ----------------定時(shí)器執(zhí)行結(jié)束-----------------------
?2019-01-11 09:21:56,433 DEBUG [Timer-1] org.apache.http.impl.conn.LoggingManagedHttpClientConnection.shutdown(87) -- http-outgoing-85: Shutdown connection
?2019-01-11 09:21:56,433 DEBUG [Timer-1] org.apache.http.impl.execchain.ConnectionHolder.abortConnection(128) -- Connection discarded
?2019-01-11 09:21:56,434 DEBUG [Timer-1] org.apache.http.impl.conn.LoggingManagedHttpClientConnection.close(79) -- http-outgoing-85: Close connection
?2019-01-11 09:21:56,434 DEBUG [Timer-1] org.apache.http.impl.conn.PoolingHttpClientConnectionManager.releaseConnection(320) -- Connection released: [id: 85][route: {}->http://183.232.34.84:8080][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 20]
?org.apache.http.conn.ConnectTimeoutException: Connect to 183.232.34.84:8080 [/183.232.34.84] failed: Connection timed out
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:149)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)
at com.ejavashop.core.HttpClientUtil.sendGet(HttpClientUtil.java:36)
at com.ejavashop.web.job.IndexCacheTimerTask.run(IndexCacheTimerTask.java:40)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)
Caused by: java.net.ConnectException: Connection timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
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.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:134)
... 13 more
2019-01-11 09:21:56,434 DEBUG [Timer-1] org.apache.http.impl.conn.PoolingHttpClientConnectionManager.shutdown(388) -- Connection manager is shutting down
?2019-01-11 09:21:56,434 DEBUG [Timer-1] org.apache.http.impl.conn.PoolingHttpClientConnectionManager.shutdown(394) -- Connection manager shut down
?2019-01-11 09:21:56,434 INFO [Timer-1] com.ejavashop.web.job.IndexCacheTimerTask.run(46) -- ----------------定時(shí)器執(zhí)行結(jié)束-----------------------
2.
首先從main方法開始莫矗。擎宝。。圖中箭頭從左到右依次為 手機(jī)號拦惋,模板號憎亚,驗(yàn)證碼员寇。。有效期
3. 檢查一些參數(shù)
4.執(zhí)行main方法
發(fā)現(xiàn)本地能發(fā)送短信第美,服務(wù)器卻超時(shí)
5.解決方法蝶锋。。什往。由于服務(wù)器和本地的環(huán)境不同扳缕。。檢查端口是否開放權(quán)限
最重要的….將ip從沙箱設(shè)置為app…SERVER_IP?=?"app.cloopen.com";
6. clean install package 上傳服務(wù)器
完成