Export to GitHub

gdata-scala-client - issue #1

Private Google Groups Feed Parsing Error


Posted on May 11, 2008 by Massive Cat

What steps will reproduce the problem? 1. Take a google group that needs authentication like "Tips4Trade" 2. Take the atom feed: "https://groups.google.com/group/Tips4Trade/feed/atom_v1_0_msgs.xml" 3. Follow steps in section "How to use the library on not-yet-supported services" of user guide 4. Error while doing "val f = s.query(feed, atomFeed.feedPickler)"

What is the expected output? What do you see instead? Expected output should be a list of entries (works for public group feeds) Instead I get this error: [Fatal Error] :35:6: The string "--" is not permitted within comments. Exception in thread "main" java.lang.ExceptionInInitializerError at tmp.Test.main(Test.scala) Caused by: org.xml.sax.SAXParseException: The string "--" is not permitted within comments. at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at scala.xml.parsing.FactoryAdapter.loadXML(FactoryAdapter.scala:292) at scala.xml.parsing.NoBindingFactoryAdapter.loadXML(NoBindingFactoryAdapter.scala:60) at scala.xml.XML$.load(XML.scala:64) at com.google.xml.combinators.LinearStore$.fromInputStream(LinearStore.scala:186) at com.google.gdata.client.GDataRequest.unpickle(GDataRequest.scala:131) at com.google.gdata.Service.query(Service.scala:109) at com.google.gdata.Service.query(Service.scala:96) at tmp.Test$.<init>(Test.scala:14) at tmp.Test$.<clinit>(Test.scala) ... 1 more

What version of the product are you using? On what operating system? version 0.1 on Windows XP, J2SE 1.6, Scala 2.7.1

Please provide any additional information below.

Comment #1

Posted on May 13, 2008 by Helpful Horse

I cannot reproduce it with groups where I'm a member... Could you please post the XML document you get if you connect to that URL (https://groups.google.com/group/Tips4Trade/feed/atom_v1_0_msgs.xml)? It seems the XML parser is complaining about an invalid comment, I wonder if that's not a bug in the SAX libraries (or the server is generating invalid XML).

Comment #2

Posted on May 13, 2008 by Helpful Horse

(No comment was entered for this change.)

Comment #3

Posted on May 14, 2008 by Massive Cat

Here is the file.

Attachments

Comment #4

Posted on May 14, 2008 by Helpful Horse

This is weird, this file is successfully parsed on my machine. Can you try the following, in the Scala interpreter:

scala> val input = LinearStore.fromFile("atom_v1_0_msgs.xml") scala> import com.google.gdata.data._ import com.google.gdata.data._

scala> val feed = new StdAtomFeed feed: com.google.gdata.data.StdAtomFeed = com.google.gdata.data.StdAtomFeed@4078ee

scala> feed.feedPickler.unpickle(input) res4: com.google.xml.combinators.Picklers.PicklerResult[feed.Feed] = Success(Authors: Id: http://groups.google.com/group/Tips4Trade Title: (Some(text),Tips4Trade Google Group) Updated: 2008-05-05T18:01:34.000Z Entries: Entry: Authors: (Tips4 Trade,None,Some(tips4tr...@gmail.com)) Id: Some(http://groups.google.com/group/Tips4Trade/msg/9b6e7d751aaea5d8) Title: (Some(text),Platinum ... scala>

If that works, try to get the messages that were breaking the library in the first place, and save that file. I assume it is the content of some message in the group that is incorrectly encoded.

Comment #5

Posted on May 16, 2008 by Massive Cat

Well, your steps worked for me also. But the actual code doesn't. So I created a dummy account with membership of this group (will mail you username/password in separate mail). Here is my snippet:

import com.google.gdata.Service import com.google.gdata.data.StdAtomFeed

object GData1 extends Application { val s = new Service("comp-test-1.0", "cp") {} s.setUserCredentials("USER", "PASSWORD") val atomFeed = new StdAtomFeed val feed = "http://groups.google.com/group/Tips4Trade/feed/atom_v1_0_msgs.xml" val f = s.query(feed, atomFeed.feedPickler) println(f.entries.head) }

Comment #6

Posted on May 16, 2008 by Helpful Horse

Ok, it looks like a xerces bug:

http://issues.apache.org/jira/browse/XERCESJ-477 http://issues.apache.org/jira/browse/XERCESJ-520

I'm not sure yet if there are any workarounds, I will keep looking.

Status: Started

Labels:
Type-Defect Priority-Medium