? cannot read /www1/cap_atom/web/cap/us.atomcom.sun.syndication.io.ParsingFeedException: Invalid XML: Error on line 1: Content is not allowed in prolog. at com.google.publicalerts.cap.feed.CapFeedParser$DocBuilder.buildDocument(CapFeedParser.java:465)
<feed xmlns:cap="urn:oasis:names:tc:emergency:cap:1.1" xmlns="http://www.w3.org/2005/Atom" xmlns:ha="http://www.alerting.net/namespace/index_1.0"> <id>http://alerts.weather.gov/cap/us.atom</id> <logo>http://alerts.weather.gov/images/xml_logo.gif</logo> <generator>NWS CAP Server</generator> <updated>2012-12-04T0-2:38:00-08:00</updated>
CapException[reasons=[character content of element "updated" invalid; must be an ISO date and time]] at com.google.publicalerts.cap.feed.CapFeedParser.validate(CapFeedParser.java:290)
CapException[reasons=[cvc-complex-type.2.4.a: Invalid content was found starting with element 'event'. One of '{"urn:oasis:names:tc:emergency:cap:1.1":language, "urn:oasis:names:tc:emergency:cap:1.1":category}' is expected.]]
at com.google.publicalerts.cap.feed.CapFeedParser.parseAlert(CapFeedParser.java:372)java.net.SocketTimeoutException: Timeout while fetching URL: http://www.vialert.gov/Public/News/GetCapAlert.aspx?notID=3293245 at com.google.appengine.api.urlfetch.URLFetchServiceImpl.convertApplicationException(URLFetchServiceImpl.java:142) at com.google.appengine.api.urlfetch.URLFetchServiceImpl.fetch(URLFetchServiceImpl.java:43) at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.fetchResponse(URLFetchServiceStreamHandler.java:417) at com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection.getInputStream(URLFetchServiceStreamHandler.java:296) at java.net.URL.openStream(URL.java:1029)
Hello.I've setup the cap-library to successfully parse 1000+ alerts from various publishers over the past few weeks. I am hoping that I could get confirmation that I am using the library correctly and that the following errors need to be addressed upstream of my application? I've included the relevant portion of the message Alert Hub is sending my Callback Servlet inside req.getReader() and the exception it is ultimately producing.#1 - Alert Hub sometimes passes along an error message from a publishers feed?? cannot read /www1/cap_atom/web/cap/us.atomcom.sun.syndication.io.ParsingFeedException: Invalid XML: Error on line 1: Content is not allowed in prolog. at com.google.publicalerts.cap.feed.CapFeedParser$DocBuilder.buildDocument(CapFeedParser.java:465)
#2 - NWS (http://alerts.weather.gov/cap/us.php?x=1) occasionally has an invalid time in their ATOM feed <updated> element? From what I understand, the parser expects <updated> to contain a RFC 3339 formatted date and chokes when it sees '0-' after the 'T' character?
<feed xmlns:cap="urn:oasis:names:tc:emergency:cap:1.1" xmlns="http://www.w3.org/2005/Atom" xmlns:ha="http://www.alerting.net/namespace/index_1.0"> <id>http://alerts.weather.gov/cap/us.atom</id> <logo>http://alerts.weather.gov/images/xml_logo.gif</logo> <generator>NWS CAP Server</generator> <updated>2012-12-04T0-2:38:00-08:00</updated>CapException[reasons=[character content of element "updated" invalid; must be an ISO date and time]] at com.google.publicalerts.cap.feed.CapFeedParser.validate(CapFeedParser.java:290)#3 - NYAlert (http://rss.nyalert.gov/RSS/CapIndices/_NewYorkStateRSSCAPIndex.xml) incorrectly orders the elements in <area> ?
CapException[reasons=[cvc-complex-type.2.4.a: Invalid content was found starting with element 'event'. One of '{"urn:oasis:names:tc:emergency:cap:1.1":language, "urn:oasis:names:tc:emergency:cap:1.1":category}' is expected.]] at com.google.publicalerts.cap.feed.CapFeedParser.parseAlert(CapFeedParser.java:372)#4 - vialert.gov (http://rss.vialert.gov/RSS/CapIndices/_ALLVIRSSCAPIndex.xml) includes high resolution polygons for the entire territory and causes timeout exceptions on GAE.