2012-06-19 59 views
0

我已經收到這個異常from time to time Web服務,while accessing the webserviceprovided by this site.無法訪問有時

webservice:https://int.yumzing.com/index.php?func=sessionCreate

它適用於有時,然後它沒有。 我已經嘗試ping網站「int.yumzing.com」,這個工程.... 但more frequently its inaccessible when i am trying to access the web service通過我的程序,傳遞用戶名和密碼。

If there was some problem with my program, then it wouldnt had been accessible even foronce... but it works from time to time.

我現來襲到這一點,因爲我不能明白,什麼可能是問題的根源。

請參閱下面的異常,What i know is that UnknownHostException will take place when there is a problem in the Intial Connection.

java.net.UnknownHostException: int.yumzing.com 
at java.net.InetAddress.lookupHostByName(InetAddress.java:513) 
at java.net.InetAddress.getAllByNameImpl(InetAddress.java:278) 
at java.net.InetAddress.getAllByName(InetAddress.java:242) 
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136) 
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:164) 
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:119) 
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:348) 
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:555) 
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:487) 
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:465) 
at com.yum.zing.APIHandling$1.run(APIHandling.java:415) 
at java.lang.Thread.run(Thread.java:1096) 
+1

可能上網的問題... – Ketan

+0

什麼你IDE?和服務器是它tomacat – shareef

+0

我正在使用Eclipse。但我不知道是否服務器,無論其tomcat或不 –

回答

1

任何主機名,你的情況int.yumzing.com某處映射到一臺機器到IP。例如,當你有一個經常變化的動態IP時,這很有用,因爲它允許客戶端和服務器之間的透明通信。否則,每當IP地址發生變化時,都應該知道所有的客戶端。

當有人試圖通過其域名訪問服務器時,會啓動級聯DNS調用,以便查找目標機器的IP並建立連接。對於一些互聯網相關的原因,大多數可能在你身邊,解決過程失敗,你會得到上述錯誤。

有關DNS更多信息看看http://en.wikipedia.org/wiki/Domain_Name_System

+0

我明白你的觀點。但是,請你指出我的原因和解決辦法。 –

+0

我並不認爲你可以對此做很多事情,因爲有時你的互聯網提供商可能會遇到問題,但有時候也會在'yumzing network'內。從你的應用程序的角度來看,我想你可以爲用戶提供一個很好的錯誤信息和重試機制。 – Morfic