<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "java.net.ProtocolException: Server redirected too many  times (20)"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "java.net.ProtocolException: Server redirected too many  times (20)"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>java.net.ProtocolException: Server redirected too many  times (20)</title>
				<description><![CDATA[ Hi,

I am using the java client to resolve timezones and I keep getting a java.net.ProtocolException: Server redirected too many  times (20).

Here is a snippet of the stacktrace:

Sep 11, 2008 10:49:41 AM org.geonames.WebService connect
WARNING: problems connecting to geonames server http://ws.geonames.org
java.net.ProtocolException: Server redirected too many  times (20)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1182)
	at org.geonames.WebService.connect(Unknown Source)
	at org.geonames.WebService.timezone(Unknown Source)

I copied some source from WebService.connect into a test case I wrote and was able to pinpoint to line 148 of WebService.java:

conn.setRequestProperty("User-Agent", USER_AGENT);

When I exclude that line from the source I copied into my test case, the problem goes away.  I am not sure why setting a request property on the connection would cause such an exception.  Is anyone else having the same problem?  Can someone tell me if that is a bug on my end and what I need to do to get around it?  Ideally I would not have to keep my own renegade copy of WebService.java in my src.]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/1057.page#4651</guid>
				<link>http://forum.geonames.org/gforum/posts/list/1057.page#4651</link>
				<pubDate><![CDATA[Thu, 11 Sep 2008 19:56:19]]> GMT</pubDate>
				<author><![CDATA[ Bobby Yang]]></author>
			</item>
	</channel>
</rss>