我複製了代碼示例,說明如何查詢Java Toolkit for Rally Rest頁面底部的前5個最高優先級缺陷。Rally Java Rest Unknownhost異常
我相應地更改了用戶名和密碼,但我得到的是UnknownHostException
。
這裏是堆棧跟蹤:
log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.BasicClientConnectionManager). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" java.net.UnknownHostException: rally1.rallydev.com at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:849) at java.net.InetAddress.getAddressFromNameService(InetAddress.java:1202) at java.net.InetAddress.getAllByName0(InetAddress.java:1153) at java.net.InetAddress.getAllByName(InetAddress.java:1083) at java.net.InetAddress.getAllByName(InetAddress.java:1019) at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45) at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:278) at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162) at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294) at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640) at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784) at com.rallydev.rest.RallyRestApi.doRequest(RallyRestApi.java:253) at com.rallydev.rest.RallyRestApi.doGet(RallyRestApi.java:323) at com.rallydev.rest.RallyRestApi.query(RallyRestApi.java:179) at com.jdes.AgileToRally.AgileToRally.main(AgileToRally.java:37)
37號線:QueryResponse queryResponse = restApi.query(defects);
我試圖改變服務器名稱,用戶名和密碼,但我有沒有運氣。
感謝
添加如下內容:'System.setProperty(「java.net.preferIPv4Stack」,「true」);'? – MikeB 2013-02-18 22:42:58
@MikeB - 說實話,你必須嘗試一下。如果不研究它,我不確定何時通過JVM/Networking類讀取特定系統屬性,因此在啓動應用程序後更改它可能沒有任何作用。 – 2013-02-18 22:47:21
我試着用很多方式傳遞這個變量,他們都沒有給我一個不同的結果。你認爲這個問題可能在'log4j'中? – MikeB 2013-02-19 14:23:35