w3stling / rssreader

A simple Java library for reading RSS and Atom feeds
MIT License
150 stars 25 forks source link

Failed to read file #1

Closed Daltz333 closed 5 years ago

Daltz333 commented 5 years ago

Currently trying to read http://na.leagueoflegends.com/en/rss.html but get this error

WARNING: Failed to parse XML. 
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1]
Message: Premature end of file.
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:652)
    at com.apptastic.rssreader.RssReader$RssItemIterator.next(RssReader.java:202)
    at com.apptastic.rssreader.RssReader$RssItemIterator.peekNext(RssReader.java:177)
    at com.apptastic.rssreader.RssReader$RssItemIterator.hasNext(RssReader.java:187)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:132)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
    at Commands.CustomCommands.Subscribers.RssLeagueThread.run(RssLeagueThread.java:43)
    at java.base/java.lang.Thread.run(Thread.java:834)

I suspect the website is blocking the connection? As that URL and XML is perfectly valid.

Daltz333 commented 5 years ago

An option could be the pass in the contents of the XML as a string? As perhaps a "parse" method?

w3stling commented 5 years ago

The problem is that the content for that URL is regular html, not RSS or atom.

I found another URL that contains an atom feed. https://na.leagueoflegends.com/en/rss.xml

Daltz333 commented 5 years ago

Yes. That URL worked. Sorry for the issue.