sumeet85 / corporateaddressbook

Automatically exported from code.google.com/p/corporateaddressbook
0 stars 0 forks source link

XML Parser error on some search results #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Search for a contact
2. Some work fine, others result in error message

What is the expected output? What do you see instead?
Activesync version= 12
org.xmlpull.v1.XmlPullParserException:
name expected (position:START_TAG<foobar>@1:273 in 
java.io.InputStreamReader@4502af80)

What version of the product are you using?
1.2.2

What version of Android are you running?
CyanogenMOD 6.1

What version of Exchange are you connecting to?
Kerio Mailserver 7.1.3

Please provide any additional information below.
This only seems to happen with contacts that have a lot of information 
associated with them. A contact with just a name, number, and email works fine. 
Ones with multiple email accounts, numbers, etc have the problem.

In the error message, foobar is the first part of an email address 
(foobar@domain.com).

Logcat output:
W/System.err(10345): org.xmlpull.v1.XmlPullParserException: name expected 
(position:START_TAG <foobar>@1:267 in jav
a.io.InputStreamReader@450efce0)
W/System.err(10345):    at 
org.kxml2.io.KXmlParser.exception(KXmlParser.java:273)
W/System.err(10345):    at org.kxml2.io.KXmlParser.error(KXmlParser.java:269)
W/System.err(10345):    at org.kxml2.io.KXmlParser.readName(KXmlParser.java:970)
W/System.err(10345):    at 
org.kxml2.io.KXmlParser.parseStartTag(KXmlParser.java:677)
W/System.err(10345):    at org.kxml2.io.KXmlParser.nextImpl(KXmlParser.java:342)
W/System.err(10345):    at org.kxml2.io.KXmlParser.next(KXmlParser.java:1385)
W/System.err(10345):    at 
org.xmlpull.v1.sax2.Driver.parseSubTree(Driver.java:449)
D/dalvikvm(10345): GC_FOR_MALLOC freed 2582 objects / 145752 bytes in 40ms
W/System.err(10345):    at org.xmlpull.v1.sax2.Driver.parse(Driver.java:340)
W/System.err(10345):    at 
net.vivekiyer.GAL.CorporateAddressBook.parseXML(CorporateAddressBook.java:319)
W/System.err(10345):    at 
net.vivekiyer.GAL.CorporateAddressBook$GALSearch.doInBackground(CorporateAddress
Book.java:488
)
W/System.err(10345):    at 
net.vivekiyer.GAL.CorporateAddressBook$GALSearch.doInBackground(CorporateAddress
Book.java:1)
W/System.err(10345):    at android.os.AsyncTask$2.call(AsyncTask.java:185)
W/System.err(10345):    at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
W/System.err(10345):    at 
java.util.concurrent.FutureTask.run(FutureTask.java:137)
W/System.err(10345):    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
W/System.err(10345):    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
W/System.err(10345):    at java.lang.Thread.run(Thread.java:1096)

Original issue reported on code.google.com by mmoo...@mmoogle.org on 24 Jan 2011 at 6:33

GoogleCodeExporter commented 9 years ago
Hi there

Thank you for your message and detailed information about the crash. Will you 
be perhaps willing to install a DEBUG build? I would like to look at the actual 
XML that is returned by your server and see why the parser is failing. The logs 
generated by this debug build will not be sent to me automatically. You can 
view and edit the information in the logs before you send them across to me, so 
please do not worry, your information will be secure. 

Regards
Vivek

Original comment by viveki...@gmail.com on 24 Jan 2011 at 6:29

GoogleCodeExporter commented 9 years ago
Sure, I can install a Debug build. 

Original comment by mmoo...@mmoogle.org on 24 Jan 2011 at 9:59

GoogleCodeExporter commented 9 years ago
Great!

I will send you a build later tonight. Hopefully we can get to the bottom of 
this issue and get this resolved. 

Original comment by viveki...@gmail.com on 24 Jan 2011 at 11:16

GoogleCodeExporter commented 9 years ago
Can you please install v 1.2.2.1 from 
http://code.google.com/p/corporateaddressbook/downloads/list

This should generate an email with the XML that is causing an issue.

Please note 
- The email does not get sent to me automatically.
- You can see and edit the contents of the email before you hit send. That way 
you can be assured that I am not acquiring any of your personal information.
- Also if you like the source code for this release, you can see it here
http://code.google.com/p/corporateaddressbook/source/browse/#svn%2Fbranches%2Fde
bug_1.2.2
You will need to enable installation of applications from Unknown sources in 
order to install the beta release
Home -> Settings -> Applications -> Unknown Sources -> Check

Thanks
Vivek

Original comment by viveki...@gmail.com on 25 Jan 2011 at 7:24

GoogleCodeExporter commented 9 years ago
Here's the anonymized output:
org.xmlpull.v1.XmlPullParserException: name expected (position:START_TAG 
<LastnameFirstnameM>@1:267 in java.io.InputStreamReader@45052368) 
<?xml version="1.0" encoding="utf-8" ?><Search 
xmlns="Search"><Status>1</Status><Response><Store><Status>1</Status><Result><Pro
perties><DisplayName>Firstname 
Lastname</DisplayName><FirstName>Firstname</FirstName><LastName>Lastname</LastNa
me><EmailAddress>"Firstname Lastname" 
<LastnameFirstnameM@domain.com></EmailAddress><Phone>(123) 
456-7890</Phone><Company>Bobs Widgets</Company><MobilePhone>(123) 
456-7800</MobilePhone></Properties></Result><Result><Properties><DisplayName> 
</DisplayName><EmailAddress>FirstnameLastname@otherdomain.com</EmailAddress></Pr
operties></Result><Range>0-1</Range><Total>2</Total></Store></Response></Search>

Original comment by mmoo...@mmoogle.org on 25 Jan 2011 at 11:29

GoogleCodeExporter commented 9 years ago
So it looks like the XML returned from your server contains this line (or 
something that looks like this)

<EmailAddress>"Firstname Lastname" 
<LastnameFirstnameM@domain.com></EmailAddress>

This is not valid XML, and that is why the XML parser barfs and dies a 
miserable death :). I will see if I can work around this.

Original comment by viveki...@gmail.com on 25 Jan 2011 at 11:39

GoogleCodeExporter commented 9 years ago
Yeah, it looks like it's not escaping/formatting the address properly. I've run 
into similar issues with the server's CalDAV XML output before, so it doesn't 
surprise me that they're doing something incorrect here as well. If you could 
hack in a workaround on your end, that would be great!

Original comment by mmoo...@mmoogle.org on 26 Jan 2011 at 12:25

GoogleCodeExporter commented 9 years ago
Hi there

I know it has been a while, but I think I have a fix for this. Are you still 
using this app? If yes, will you be willing to install another debug version?

Thanks
Vivek

Original comment by viveki...@gmail.com on 4 May 2011 at 7:05

GoogleCodeExporter commented 9 years ago
Sure, I'll give another one a shot.

Original comment by mmoo...@mmoogle.org on 16 May 2011 at 10:09

GoogleCodeExporter commented 9 years ago
Awesome. Can you try to install v1.2.4_debug1 from
http://code.google.com/p/corporateaddressbook/downloads/list

Original comment by viveki...@gmail.com on 16 May 2011 at 10:30

GoogleCodeExporter commented 9 years ago
That seems to have fixed it. Thanks!

Original comment by mmoo...@mmoogle.org on 16 May 2011 at 10:50

GoogleCodeExporter commented 9 years ago
Sweet! I will merge this into the next release, and let you know when it is 
available in the market. Thanks for being patient and helping me debug the 
issue.

Original comment by viveki...@gmail.com on 16 May 2011 at 11:03