ROME 1.6 seems to not work on Android
See original GitHub issueI recently started to use ROME and jumped directly to 1.6. Therefore, when trying to get a feed I always get the same error
com.rometools.rome.io.ParsingFeedException: Invalid XML [...] Caused by: org.jdom2.JDOMException: http://apache.org/xml/features/disallow-doctype-decl feature not recognized for SAX driver org.apache.harmony.xml.ExpatReader
I used some sample codes found on the web, but all are using older versions of ROME tools. As they actually, I tried to use the same RSS feeds they use, I’ve got the same error. Note that every working example that I found used FeedFetcher.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Resource linking fails on lStar - android - Stack Overflow
Go to android/build.gradle and add androidXCore = "1.6.0" to ext: ... if you are not using core-ktx maybe one of your dependent libraries...
Read more >Phone doesn't re-acquire lost cell signal [36907983]
I understand there seems to be an Android bug switching back/forth between 2g and 3g or the phone not re-connecting after it loses...
Read more >LG Flash Tool 2.0.1.6 (patched & working) - XDA Forums
I've patched LGFlashTool.exe to bypass the login screen. This is for flashing back to stock. It does not flash TWRP or root your...
Read more >Kotlin 1.6.0 Released - The JetBrains Blog
If you use IntelliJ IDEA or Android Studio, you have the option to ... However, that didn't work in Kotlin versions prior to...
Read more >Steam/Game-specific troubleshooting - ArchWiki
Gamepad not working. The version of libSDL2 shipped with the game seems to be out-of-date and may not support your gamepad yet. Simply...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@PatrickGotthard @morphet81 Do we want to realease this bugfix as version
1.6.1
?Thank you for the report @morphet81! I looked into it and it seems to be a bug in Rome that was introduced in 2bc58a0. The change in the order of calls to
parser.setFeature
andsaxBuilder.setFeature
is what broke the code. Can’t blame Patrick for that though, because original authors of that code did nothing to indicate that the order matters and prevent this from happening.The fix is simple: swap around the lines 373 and 374 in
WireFeedInput
. Feel free to do it (preferably with a test to make sure it doesn’t happen again).So why does the order matter? Because it’s the call to
parser.setFeature
that throws aSAXNotRecognizedException
exception, i.e. tells us whether the feature is recognized or not. We don’t want to callsaxBuilder.setFeature
with an unrecognized feature, because it will silently accept it and throw aJDOMException
later inSAXBuilder.build
method. The problem is that at that point we’ve already lost the context and the only way to figure out what’s going on is to parse the message of the exception. We don’t want to rely on exception message though.So basically we’re abusing
parser.setFeature
to find out if the feature is recognized and supported before we set it on thesaxBuilder
. Key word here is “before” 😃