I checked the code after a beer and now I know what the issue is. In fact the ResourceUtils code did not change since Solr 4.0 where
SOLR-4007 was reported on. This was using version 1.5.5 of Morphologik.
The problem is very simple:
- Morphologic tries context class loader first, obviously this fails for Solr (SOLR-3716)
- As a second try it does "the right thing" but obviously wrong: It uses ResourceUtil.class.getResourceAsStream(), and this fails because when loading the resource it uses an absolute path inclusive package, but without a slash. This of course fails, because the file is not found. This causes Solr fail.
- Finally it tries the system classloader. Of course the resource isn't there, because the system classloader has no morphologic jars
The issue here is the stupid java difference: If you use a Classloader, you don't need leading slash. If you use Class#getResource() it resolves against current package, so you need a leading slash, if you want it with an absolute path.
In single classloader applications this is no issue, because the context classloader always works, but not in Solr.