[MNG-6275] ServiceLoaderFactory can't find implementations via ClassRealm
- Dominant language
- Java
- Stars
- 5.3k
- Forks
- 3.1k
- Avg merge
- 20h 42m
- Merged PRs (30d)
- 297
Description
**[Robert Scholte](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=rfscholte)** opened **[MNG-6275](https://issues.apache.org/jira/browse/MNG-6275?redirect=false)** and commented
Spotted this issue via MANTRUN-200. The reason is that in the `DefaultClassRealmManager` a new realm is created where the parent classLoader is `null`. This implies that the bootstrap classloader is used as parent.
With Java8 nashorn has become an extension and is not part of the bootstrap classloader anymore.
It is kind of strange that we want the bootstrap classloader here, it makes more sense if the system classloader is used (but with Java 7 and older versions of Java this was not an issue, both worked fine).
---
**Issue Links:**
- [MANTRUN-200](https://issues.apache.org/jira/browse/MANTRUN-200) Scriptdef tasks fail to load when running on Java9
- [MNG-6371](https://issues.apache.org/jira/browse/MNG-6371) Use ServiceLoader mechanism in JDK9 in maven plugins
0 votes, 11 watchers
Contributor guide
Assessment
This issue has not been assessed yet.