java調(diào)用第三方短信接口 本地能發(fā)送短信,服務(wù)器卻發(fā)不了,直到超時(shí)

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ù)器

完成

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
  • 序言:七十年代末别威,一起剝皮案震驚了整個(gè)濱河市躯舔,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌省古,老刑警劉巖粥庄,帶你破解...
    沈念sama閱讀 211,743評論 6 492
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異豺妓,居然都是意外死亡惜互,警方通過查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 90,296評論 3 385
  • 文/潘曉璐 我一進(jìn)店門琳拭,熙熙樓的掌柜王于貴愁眉苦臉地迎上來载佳,“玉大人,你說我怎么就攤上這事臀栈∧杌郏” “怎么了?”我有些...
    開封第一講書人閱讀 157,285評論 0 348
  • 文/不壞的土叔 我叫張陵权薯,是天一觀的道長姑躲。 經(jīng)常有香客問我睡扬,道長,這世上最難降的妖魔是什么黍析? 我笑而不...
    開封第一講書人閱讀 56,485評論 1 283
  • 正文 為了忘掉前任卖怜,我火速辦了婚禮,結(jié)果婚禮上阐枣,老公的妹妹穿的比我還像新娘马靠。我一直安慰自己,他們只是感情好蔼两,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,581評論 6 386
  • 文/花漫 我一把揭開白布甩鳄。 她就那樣靜靜地躺著,像睡著了一般额划。 火紅的嫁衣襯著肌膚如雪妙啃。 梳的紋絲不亂的頭發(fā)上,一...
    開封第一講書人閱讀 49,821評論 1 290
  • 那天俊戳,我揣著相機(jī)與錄音揖赴,去河邊找鬼。 笑死抑胎,一個(gè)胖子當(dāng)著我的面吹牛燥滑,可吹牛的內(nèi)容都是我干的。 我是一名探鬼主播阿逃,決...
    沈念sama閱讀 38,960評論 3 408
  • 文/蒼蘭香墨 我猛地睜開眼铭拧,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了盆昙?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 37,719評論 0 266
  • 序言:老撾萬榮一對情侶失蹤焊虏,失蹤者是張志新(化名)和其女友劉穎淡喜,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體诵闭,經(jīng)...
    沈念sama閱讀 44,186評論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡炼团,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,516評論 2 327
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了疏尿。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片瘟芝。...
    茶點(diǎn)故事閱讀 38,650評論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖褥琐,靈堂內(nèi)的尸體忽然破棺而出锌俱,到底是詐尸還是另有隱情,我是刑警寧澤敌呈,帶...
    沈念sama閱讀 34,329評論 4 330
  • 正文 年R本政府宣布贸宏,位于F島的核電站造寝,受9級特大地震影響,放射性物質(zhì)發(fā)生泄漏吭练。R本人自食惡果不足惜诫龙,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,936評論 3 313
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望鲫咽。 院中可真熱鬧签赃,春花似錦、人聲如沸分尸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,757評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽寓落。三九已至括丁,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間伶选,已是汗流浹背史飞。 一陣腳步聲響...
    開封第一講書人閱讀 31,991評論 1 266
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留仰税,地道東北人构资。 一個(gè)月前我還...
    沈念sama閱讀 46,370評論 2 360
  • 正文 我出身青樓,卻偏偏與公主長得像陨簇,于是被迫代替她去往敵國和親吐绵。 傳聞我的和親對象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,527評論 2 349

推薦閱讀更多精彩內(nèi)容

  • 問題分析: 問題一 org.apache.hadoop.ipc.RemoteException(org.apach...
    xhh199090閱讀 5,303評論 0 2
  • 1河绽、運(yùn)行環(huán)境 主機(jī)IP 主機(jī)名 2己单、配置主機(jī)名(分別在五臺(tái)機(jī)器上執(zhí)行) hostname +主機(jī)名例如: h...
    獻(xiàn)給記性不好的自己閱讀 3,546評論 0 6
  • 最近項(xiàng)目需要使用 Java 重度調(diào)用 HTTP API 接口,于是想著封裝一個(gè)團(tuán)隊(duì)公用的 HTTP client ...
    java菜閱讀 743評論 0 3
  • 古城西安耙饰,到鐘鼓樓的那一刻纹笼,我便被這里的古風(fēng)建筑吸引,在西安市里苟跪,這里還有著曾經(jīng)的城墻萬里廷痘,這座城市給人一種莫名的...
    簡單影評閱讀 277評論 0 2
  • 周末身體不適,就放縱了下自己件已,停更了兩天笋额。這兩天還是會(huì)補(bǔ)上,給自己一個(gè)交代篷扩。 雖是小小不適兄猩,還是人懶散了很多,除了...
    李軒若閱讀 264評論 0 0