abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Mendoza <oliver.mend...@burlesontech.com>
Subject AbderaClient.get() question
Date Tue, 13 Apr 2010 16:02:40 GMT
Hi all,

I've been using Abdera to get some RSS Feeds and converting them to JSON format. I can do
all this locally in a JSP using Eclipse+Tomcat but my problem is when I move this JSP to a
remote server, it doesn't work and returns an exception:

"java.net.SocketException: Connection timed out:could be due to invalid address."

I pass the RSS URL as a parameter in the URL of my JSP page and what I understand of the exception
is that client.get( urlParameter ) cannot reach the host of the RSS URL, which make me ask
if there is anything in the AbderaClient.get() method that modifies or replaces some characters
in the URL or if it encodes the URL before making the request? Maybe based on Character Set
of the server? 

I say that this same JSP works locally but not in a remote server so would you say it's a
server (on which I'm testing) related problem only and nothing specific about AbderaClient.get()
method?


This is my code:
----------------------------------------------------------------------------------------------------------
String urlParameter = request.getParameter("url").toString();
Abdera abderaObj = new Abdera();
AbderaClient client = new AbderaClient(abderaObj);
	    
ClientResponse resp = client.get( urlParameter ); 

if (resp.getType() == ResponseType.SUCCESS) {
	Document<Feed> doc = resp.getDocument();
	Writer json = abderaObj.getWriterFactory().getWriter("json");
	doc.writeTo(json, out);
} else {
	out.print( "<h1>There was an error parsing the RSS feed:</h1><h3> " + resp.getStatusText()
+ "</h3>" );
}
------------------------------------------------------------------------------------------------------------

Thanks.
Mime
View raw message