3 messages in com.googlegroups.bloggerdev[bloggerDev] I got exception when I u...| From | Sent On | Attachments |
|---|---|---|
| BNU ACMer | 13 Jun 2008 02:14 | |
| Jeff Scudder | 16 Jun 2008 17:27 | |
| BNU ACMer | 16 Jun 2008 19:27 |
| Subject: | [bloggerDev] I got exception when I user google's blog sample![]() |
|---|---|
| From: | BNU ACMer (tang...@gmail.com) |
| Date: | 06/13/2008 02:14:20 AM |
| List: | com.googlegroups.bloggerdev |
the sample code is very simple as following:
import java.net.URL;
import com.google.gdata.client.GoogleService; import com.google.gdata.data.Entry; import com.google.gdata.data.Feed;
public class MyBloger { public static void main(String[] args) { try { GoogleService myService = new GoogleService("blogger", "myprogram"); myService.setUserCredentials("tang...@gmail.com", "mypassword"); // Request the feed final URL feedUrl = new URL( "http://www.blogger.com/feeds/default/blogs"); Feed resultFeed = myService.getFeed(feedUrl, Feed.class);
// Print the results System.out.println(resultFeed.getTitle().getPlainText()); for (int i = 0; i < resultFeed.getEntries().size(); i++) { Entry entry = resultFeed.getEntries().get(i); System.out.println("\t" + entry.getTitle().getPlainText()); }
} catch (Exception e) { e.printStackTrace(); }
} }
But I got exception when code runs to line: "Feed resultFeed = myService.getFeed(feedUrl, Feed.class);"
The exception is :
java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) at java.io.BufferedInputStream.read1(BufferedInputStream.java:258) at java.io.BufferedInputStream.read(BufferedInputStream.java:317) at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:687) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:632) at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:652) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java: 1000) at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java: 373) at com.google.gdata.client.http.HttpGDataRequest.checkResponse(Unknown Source) at com.google.gdata.client.http.HttpGDataRequest.execute(Unknown Source) at com.google.gdata.client.http.GoogleGDataRequest.execute(Unknown Source) at com.google.gdata.client.Service.getFeed(Unknown Source) at com.google.gdata.client.Service.getFeed(Unknown Source) at com.google.gdata.client.GoogleService.getFeed(Unknown Source) at com.google.gdata.client.Service.getFeed(Unknown Source) at MyBloger.main(MyBloger.java:18)
Does anyone knows the reason ? My have finished most of my google blog management project , It runs ok until yesterday I can't use it to get information. And I found the exception comes from google's API. So, I am wondering if there is any thing wrong . Thanks very much !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Blogger Data API" group.
To post to this group, send email to blog...@googlegroups.com
To unsubscribe from this group, send email to
blog...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/bloggerDev?hl=en
-~----------~----~----~----~------~----~------~--~---




