Reputation: 2452
I copied the code example that "illustrates how to query for the top 5 highest priority defects" found at the bottom of the Java Toolkit for Rally Rest page.
I changed the username and password accordingly, but I am getting an UnknownHostException
.
Here is the stacktrace:
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)
Line 37: QueryResponse queryResponse = restApi.query(defects);
I've tried changing the server name, username, and password, but I have had no luck.
Thanks
Upvotes: 1
Views: 1726
Reputation: 311
Looks like you have a proxy server in the way.
restApi.setProxy(new URI(proxyserver));
Upvotes: 1
Reputation: 76898
Looking at your stack trace it would appear your machine is attempting to look up the IPV6 address for rally1.rallydev.com
and it's failing because it doesn't have one (and then not falling back to IPV4). This indicates a problem with your machine's config (or the DNS server it's using) more than a problem in Java.
That being said, you can force the JVM to prefer IPV4 which should solve your problem:
prompt> java -Djava.net.preferIPv4Stack=true ...
If you're using an IDE you need to configure it to pass -Djava.net.preferIPv4Stack=true
to java when you run your program.
Upvotes: 1