Hi Cyril. I recommend you to try to get more information from the exception, I see that you have two empty Catch statements. Maybe the ServiceException has useful information to solve the problem.
Cheers, Julian. On Feb 3, 3:40 pm, Cyril <[email protected]> wrote: > Hello! > > I want to import contacts from Gmail for a Java Web application > (http://www.spark-angels.com/web/home.html). I tried on an example > creating a new Java project, and it works. But when I integrate my > function in the application, the function makes the start of Apache > crash... > > Here the function: > > private ArrayList<ContactBean> gmailPerform(LoginAccount > loginAccount, String userName, String password) { > ArrayList<ContactBean> contactList = new > ArrayList<ContactBean>(); > try { > /* Try to get a connexion */ > ContactsService service = new > ContactsService("SparkAngels- > importContacts-1"); > service.setUserCredentials(userName, > password); > URL feedUrl = new > URL("http://www.google.com/m8/feeds/ > contacts/"+userName+"/thin"); > ContactFeed resultFeed = > service.getFeed(feedUrl, > ContactFeed.class); > ContactFeed resultFeed = null; > /* Treat response */ > for (ContactEntry entry : > resultFeed.getEntries()) { > String contactName = > (entry.getTitle() == null) ? "" : > entry.getTitle().getPlainText(); > for (Email email : > entry.getEmailAddresses()) { > ContactBean contact = new > ContactBean > (loginAccount.getLoginAccountId(), "", contactName, email.getAddress > ()); > contactList.add(contact); > } > } > } catch (IOException ex) { > // Can't get a connexion > } catch (ServiceException ex) { > // Bad userName or password > } > return contactList; > } > > Here the Apache error (throw by the creation of a ContactsService > object) : > ERROR reading /rss.properties : com/google/gdata/client/contacts/ > ContactsService > (+) session 161E4B2C0626001DDDB3E12917A266D8 - Tue Feb 03 15:56:47 CET > 2009 > > The file rss.properties contains a lot of information of my > application, but I don't understand why the creation of a > ContactsService object tries to read this properties file. > > Thanks for help! > > Cyril Muller --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Contacts API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-contacts-api?hl=en -~----------~----~----~----~------~----~------~--~---
