[
https://issues.apache.org/jira/browse/NUTCH-2378?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15991597#comment-15991597
]
Markus Jelsma commented on NUTCH-2378:
--------------------------------------
Patch passes all tests in a clean Nutch master checkout and a complete crawl
run went all fine.
This patch solves a lot of problems on the issue of plugin dependency crap
without resolving to build tricks such as shading with Maven, that not always
works (Elasticsearch!). No more ClassNotFound or MethodNotFound or any kind of
dreaded runtime terror. Apparently, this is a similar solutions to the problem
that is already used by Tomcat and some other well-established projects.
As a bonus, this solution is required for that indexer-elastic plugin upgrade
that is due.
Big +1 for this one!
Thanks Jurian!
> ChildFirst plugin classloader
> -----------------------------
>
> Key: NUTCH-2378
> URL: https://issues.apache.org/jira/browse/NUTCH-2378
> Project: Nutch
> Issue Type: Improvement
> Affects Versions: 1.13
> Reporter: Jurian Broertjes
> Attachments: NUTCH-2378-childfirst-plugin-classloader.patch
>
>
> While working on upgrading the indexer-elastic plugin from 2.x to 5.x, I ran
> into several nasty runtime dependency issues (both local and on Hadoop).
> After seeking help on the mailing list, I still was unable to resolve these
> issues and after digging further, decided to try a different plugin
> classloader strategy.
> The normal classloader delegates class loading requests to it's parent
> classloader. This can cause all sorts of nasty runtime dependency version
> conflicts (jar hell, version conflicts), since the plugin's own classloader
> gets queried last. The child-first classloader approach tries to load a class
> from the plugin's dependencies first and when unavailable, delegates to it's
> parent classloader. This fixed the issues I had.
> The new approach can give runtime LinkageErrors, but these are easily
> resolvable (see the patch for a few examples)
> I've tested the new loader a bit and am curious about others' findings.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)