Error message -The prefix "atom" for element "atom:cc" is not bound

395 views
Skip to first unread message

Vijayraj Chauhan

unread,
Jul 29, 2011, 1:11:54 AM7/29/11
to google-co...@googlegroups.com
Hi,

I am trying to fetch the contacts of the user who have an account in google apps marketplace. While fetching the contact i get the following error

 com.google.gdata.util.ParseException: The prefix "atom" for element "atom:cc" is not bound.      at com.google.gdata.util.XmlParser.parse(XmlParser.java:695)|
      at com.google.gdata.util.XmlParser.parse(XmlParser.java:568)|
      at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:793)|
      at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:68)|
      at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)|
      at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:)|
      at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)|...
I get this error only for a particular user in that domain. It works fine when i try to fetch the contacts for other users in that same domain.
I have searched in the forum, but it seems no one have posted about this issue. Kindly help me in resolving this issue.
Thanks,
Vijayraj

 


Alain Vongsouvanh

unread,
Aug 1, 2011, 12:20:48 PM8/1/11
to google-co...@googlegroups.com
Hello Vijayraj,

Can you try printing the XML value of the contact? You might have to use raw HTTP access or debug features of the client library in order to have access to this information.
There might be a value that breaks the XML parser used by the client library.

Best,
Alain

--
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
google-co...@googlegroups.com
To unsubscribe from this group, send email to
google-contacts...@googlegroups.com
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html



--
Alain Vongsouvanh



Vijayraj Chauhan

unread,
Aug 3, 2011, 5:28:34 AM8/3/11
to google-co...@googlegroups.com
Hi Alain,

Thanks for the reply.

Can you please tell me how to get the XML format of the contact. We are using 2 Legged OAuth java client library and this is the line where we are getting the error mentioned earlier

      ContactFeed  resultFeed = conService.getFeed(feedUrl, ContactFeed.class)


Thanks,
Vijayraj

Alain Vongsouvanh

unread,
Aug 5, 2011, 2:31:41 PM8/5/11
to google-co...@googlegroups.com
Hello Vijayraj,

Sorry about the delay in getting back to you! You can see an example of how to set a logger in ContactsExample.java
You can add the query parameter "prettyprint=true" to have the Atom prettyprinted.

I hope this helps!
Best,
Alain

Vijayraj Chauhan

unread,
Aug 8, 2011, 7:49:03 AM8/8/11
to google-co...@googlegroups.com
Hi Alain,

I have mailed you the XML format of the contact privately.
Have a look at it and do let us know the problem.

Thanks,
Vijayraj

Daniel Florey

unread,
Nov 7, 2011, 9:09:53 AM11/7/11
to google-co...@googlegroups.com
I've come across the same issue - unfortunately I just have the exception as the contacts data is privately owned by our customer:

Caused by: com.google.gdata.util.ParseException: The prefix "atom" for element "atom:cc" is not bound.
	at com.google.gdata.util.XmlParser.parse(XmlParser.java:703)
	at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
	at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
	at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:68)
	at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java:39)
	at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.java:100)
	at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java:52)
	at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:66)
	at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java:34)
	at com.google.gdata.client.Service.parseResponseData(Service.java:2165)
	at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
	at com.google.gdata.client.Service.getFeed(Service.java:1136)
	at com.google.gdata.client.Service.getFeed(Service.java:1077)
	at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:662)
	at com.google.gdata.client.Service.query(Service.java:1237)
	at com.google.gdata.client.Service.query(Service.java:1178)
	at com.floreysoft.ucm.server.contacts.provider.google.SyncGoogleContactsAction.collectContacts(SyncGoogleContactsAction.java:311)
	... 34 more
Caused by: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 757; The prefix "atom" for element "atom:cc" is not bound.
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:429)
	at com.google.gdata.util.XmlParser.parse(XmlParser.java:685)
	... 50 more

Alexey Panteleev

unread,
Dec 19, 2011, 8:11:51 PM12/19/11
to Google Contacts, Shared Contacts and User Profiles APIs
Hello, I seem to be experiencing a similar issue, has a reason been
identified?

Caused by: java.util.concurrent.ExecutionException:


com.google.gdata.util.ParseException: The prefix "atom" for element
"atom:cc" is not bound.

at java.util.concurrent.FutureTask
$Sync.innerGet(FutureTask.java:222)
at java.util.concurrent.FutureTask.get(FutureTask.java:83)
at
com.yoxel.sync.mail.AccountHandler.collectParallelSyncs(AccountHandler.java:
353)
... 8 more

at com.google.gdata.client.Service.getFeed(Service.java:1034)
at
com.yoxel.sync.imap.PeopleSynchronizer.call(PeopleSynchronizer.java:
143)
... 5 more
Caused by: org.xml.sax.SAXParseException: The prefix "atom" for


element "atom:cc" is not bound.
at

com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:
1231)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl
$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.xml.sax.helpers.ParserAdapter.parse(ParserAdapter.java:
405)
at com.google.gdata.util.XmlParser.parse(XmlParser.java:685)
... 20 more

On Nov 7, 6:09 am, Daniel Florey <daniel.flo...@gmail.com> wrote:
> I've come across the same issue - unfortunately I just have the exception
> as the contacts data is privately owned by our customer:
>
> Caused by: com.google.gdata.util.ParseException: The prefix "atom" for element "atom:cc" is not bound.
>         at com.google.gdata.util.XmlParser.parse(XmlParser.java:703)
>         at com.google.gdata.util.XmlParser.parse(XmlParser.java:576)
>         at com.google.gdata.data.BaseFeed.parseAtom(BaseFeed.java:867)
>         at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java :68)
>         at com.google.gdata.wireformats.input.AtomDataParser.parse(AtomDataParser.java :39)

>         at com.google.gdata.wireformats.input.CharacterParser.parse(CharacterParser.ja va:100)


>         at com.google.gdata.wireformats.input.XmlInputParser.parse(XmlInputParser.java :52)
>         at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java :66)
>         at com.google.gdata.wireformats.input.AtomDualParser.parse(AtomDualParser.java :34)
>         at com.google.gdata.client.Service.parseResponseData(Service.java:2165)
>         at com.google.gdata.client.Service.parseResponseData(Service.java:2098)
>         at com.google.gdata.client.Service.getFeed(Service.java:1136)
>         at com.google.gdata.client.Service.getFeed(Service.java:1077)
>         at com.google.gdata.client.GoogleService.getFeed(GoogleService.java:662)
>         at com.google.gdata.client.Service.query(Service.java:1237)
>         at com.google.gdata.client.Service.query(Service.java:1178)

>         at com.floreysoft.ucm.server.contacts.provider.google.SyncGoogleContactsAction .collectContacts(SyncGoogleContactsAction.java:311)

Message has been deleted
Message has been deleted
Message has been deleted

Alexey Panteleev

unread,
Dec 23, 2011, 10:37:56 PM12/23/11
to Google Contacts, Shared Contacts and User Profiles APIs
Hi Alain,  Any way you could help with this one? I tried using the
newer 1.46.0 version libs and that does not make
any difference. Thanks

Alexey Panteleev

unread,
Jan 2, 2012, 3:35:04 PM1/2/12
to google-co...@googlegroups.com
Vijayraj, Daniel,

Has this issue been resolved for you?

Thanks,
Aleey

Vijayraj Chauhan

unread,
Jan 3, 2012, 2:03:25 AM1/3/12
to google-co...@googlegroups.com
Hi Aleey,

This is the response Daniel gave me...

 May be one of your contact has a gd:extendedProperty set to:

<atom:cc xmlns='http://www.w3.org/2005/Atom'>0</atom:cc>

According to the documentation, a contact should be able to have arbitrary XML data in an extendedProperty element. Unfortunately, it appears that the Java GData client library is unable to parse the XML.
What I would suggest, if you don't need this element, is to delete it from your contact. However, using the Java client library won't work as it is unable to parse the entry.

You should try using raw HTTP to delete this element; one tool you could use is OAuth Playground:
  1. Select "Contacts" as scope
  2. Click on "Request Token"
  3. Click on "Authorize"
  4. You will be redirected to a Google page to grant access, please grant access
  5. Click on "Access token"
  6. Set the GData-Version to 3.0
  7. In the "Enter a feed URI" text box, enter the contact's edit URL
  8. Click on "execute"
  9. The API should return the contact's XML
  10. Copy the contact's XML in your clipboard and click on "enter post data"
  11. Paste the contact's XML in the textbox that appeared and removed the extended property that contains the "un-parsable" XML
  12. Change the request to "PUT" (instead of "GET") and click on "execute"
  13. The API should return the contact's XML with an 200 HTTP status code
If that is still not possible, please feel free to file a bug against the Java GData client library project page or try to use an other client library (Python or .NET).


Thanks
Vijayraj

Alexey Panteleev

unread,
Jan 4, 2012, 3:47:41 PM1/4/12
to google-co...@googlegroups.com
thanks Vijayraj

Vijayraj Chauhan

unread,
May 10, 2012, 2:10:01 AM5/10/12
to google-co...@googlegroups.com
Hi Daniel,

Is there any other work around for this issue other than deleting and adding the contact back???.....Its a very tedious job when you face this issue for more than 200 contacts....More over setting the logger does not print all the contacts(having this issue) at once..Can you pls help??

TIA,
Vijayraj
Reply all
Reply to author
Forward
0 new messages