question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ROME 1.6 seems to not work on Android

See original GitHub issue

I 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:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mishakocommented, May 1, 2016

@PatrickGotthard @morphet81 Do we want to realease this bugfix as version 1.6.1?

1reaction
mishakocommented, Apr 10, 2016

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 and saxBuilder.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 a SAXNotRecognizedException exception, i.e. tells us whether the feature is recognized or not. We don’t want to call saxBuilder.setFeature with an unrecognized feature, because it will silently accept it and throw a JDOMException later in SAXBuilder.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 the saxBuilder. Key word here is “before” 😃

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found