Export to GitHub

contactlistimporter - issue #1

Hotmail account Imports are not working


Posted on Apr 23, 2008 by Happy Rhino

What steps will reproduce the problem? 1. Run Test case for Hotmail Import 2. 3.

What is the expected output? What do you see instead? Expected to see the list of contacts but saw 0 contacts

What version of the product are you using? On what operating system? ContactListImporter-v1.0.zip using on Windows XP

Please provide any additional information below.

Comment #1

Posted on Apr 23, 2008 by Happy Panda

The current test-case uses a password string like "PASS" this is not the correct password for that accont, therefore it should not work.

Tou must change lines 9 in the TestCase: http://code.google.com/p/contactlistimporter/source/browse/trunk/src/test/java/com/xdatasystem/contactsimporter/ContactListImporterTest.java

Then it should work.. if it does not work... could you give me the credentials (username, password) for an account that is not working?

Note that an acccount may have zero contacts.. then the results will bes zero which is correct.

Status: Cannot reproduce My test-case retrieves 147 contacts.

Comment #2

Posted on Apr 23, 2008 by Happy Panda

PS: Checkout from the trunk to get the latest version.. I am to lazy to update the .zip. But i think nothing was changed in the .zip.. so the zip should work.

Comment #3

Posted on Apr 23, 2008 by Happy Rhino

hI there,

thanks a lot for quick reply. Problem seems to be with httpclient.Can you give me you mail so that I can mail you credentials.

here are the stack trace after running the test case for hotmail:

Testing importer: com.xdatasystem.contactsimporter.hotmail.HotmailImporter Apr 24, 2008 12:43:20 AM com.xdatasystem.contactsimporter.ContactListImporterImpl getContactList INFO: Performing login Apr 24, 2008 12:43:20 AM com.xdatasystem.contactsimporter.hotmail.HotmailImporter login INFO: Requesting login page Apr 24, 2008 12:43:23 AM com.xdatasystem.contactsimporter.hotmail.HotmailImporter login INFO: Performing login Apr 24, 2008 12:43:29 AM com.xdatasystem.contactsimporter.ContactListImporterImpl getContactList INFO: Login succeeded Apr 24, 2008 12:43:29 AM com.xdatasystem.contactsimporter.ContactListImporterImpl getAndParseContacts INFO: Retrieving contactlist [WARN] SingleClientConnManager - Invalid use of SingleClientConnManager: connection still allocated. Make sure to release the connection before allocating another one. http://by116w.bay116.mail.live.com]>java.lang.IllegalStateException: Revoking connection to HttpRoute[{}->http://by116w.bay116.mail.live.com] at org.apache.http.impl.conn.SingleClientConnManager.revokeConnection(SingleClientConnManager.java:345) at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:220) at org.apache.http.impl.conn.SingleClientConnManager.getConnection(SingleClientConnManager.java:195) at org.apache.http.impl.client.DefaultClientRequestDirector.allocateConnection(DefaultClientRequestDirector.java:508) at org.apache.http.impl.client.DefaultClientRequestDirector.execute(DefaultClientRequestDirector.java:293) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:500) at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:455) at com.xdatasystem.contactsimporter.ContactListImporterImpl.doGet(ContactListImporterImpl.java:177) at com.xdatasystem.contactsimporter.ContactListImporterImpl.getContactListContent(ContactListImporterImpl.java:114) at com.xdatasystem.contactsimporter.ContactListImporterImpl.getAndParseContacts(ContactListImporterImpl.java:102) at com.xdatasystem.contactsimporter.ContactListImporterImpl.getContactList(ContactListImporterImpl.java:88) at com.xdatasystem.contactsimporter.ContactListImporterTest.testImporter(ContactListImporterTest.java:25) at com.xdatasystem.contactsimporter.ContactListImporterTest.testHotmailImporter(ContactListImporterTest.java:15) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99) at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75) at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45) at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66) at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35) at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42) at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34) at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Apr 24, 2008 12:43:30 AM com.xdatasystem.contactsimporter.ContactListImporterImpl getAndParseContacts INFO: Parsing contactlist Number of contacts found: 0

Kapil

Comment #4

Posted on Apr 23, 2008 by Happy Rhino

I am using the latest source code for this example.

Comment #5

Posted on Apr 23, 2008 by Happy Rhino

Please try with these credentials:

makeurownrules@hotmail.com password!@#

Comment #6

Posted on Apr 23, 2008 by Happy Rhino

ok, Fixed the issue :)

Have to change HotmailImporter.java line 111 from String[] values=line.split(";"); to String[] values=line.split(",");

And also changed ContactListImporterImpl.java.

I am also attaching the modified source code.

Thanks a lot :)..If I get the chance then I ll upload the yahoo or aol version :).

Kapil

Attachments

Comment #7

Posted on Apr 23, 2008 by Happy Panda

It looks like hotmail uses both the , and the ; characters as a seperator... My hotmail accounts uses the ; character, you uses the , character...

So a correct hotmail importer should detect which seperator character to use.

I think this is a better fix:

String separator=";"; String line; int i=0; while ((line = in.readLine()) != null) { System.out.println(line); if(i>0) { if(i==1 && !line.contains(separator)) { separator=","; } String[] values=line.split(separator);

Not the best fix because checking which separator to use is not totally error free, but should work most times.

I will perform a commit so that the codebase is updated.. Anyway thank you for bringing this to my attention

b.t.w. may i ask for wich application you are using the contactlistimporter?

Comment #8

Posted on Apr 24, 2008 by Happy Rhino

I think it better to put the separator options in some configuration file like

del=;|,|~|%

And logic shall look like this :

String[] dels= prop.getPropertyString(del).split("|"); if(i==1) { foreach (del in dels){
if(line.contains(separator)){ separator=del; break; } }

}else{

//Do processing
}

I am using this for personal application which shall track my contact list.

Please also upload the other class(ContactListImporterImpl.java) in the SVN too

Cheers, Kapil

Comment #9

Posted on Apr 24, 2008 by Happy Panda

Your solution is better in the sense that it is easily extendible, but the only separator chars that are used are ; and , to my knowledge.

By the wat.. i uploaded all thechanges to the svn so the ContactListImporterImpl.java should also be the latest

However the changes to that file are minimal, the real bug was in the HotmailImporter.

Comment #10

Posted on Apr 24, 2008 by Happy Rhino

yes, your right ... Main issue was with HotmailImporter

By the way, Whats your name ?

Cheers, Kapil

Comment #11

Posted on Apr 24, 2008 by Happy Panda

Does it mattter? haha

Tjerk Wolterink

I have created this contactlistimporter for my own webapp: http://www.groopy.nl I study master computer science in Twente Enschede.

Comment #12

Posted on Apr 24, 2008 by Happy Rhino

Does n't matter at all Tjerk... :)

You site is good but cann't understand your native language (and it doesn't matter ;))..

Well, I have done master computer science from University of Illinois,Urbana Champaign.

Nice talking to you ...

Kapil

Status: Fixed

Labels:
Type-Defect Priority-Medium