You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Guillaume Nodet (Jira)" <ji...@apache.org> on 2022/01/03 16:58:00 UTC

[jira] [Commented] (MNG-6275) ServiceLoaderFactory can't find implementations via ClassRealm

    [ https://issues.apache.org/jira/browse/MNG-6275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17468099#comment-17468099 ] 

Guillaume Nodet commented on MNG-6275:
--------------------------------------

I think a better solution was provided with https://github.com/apache/maven/commit/39004f6aee634a0ac6daa1f99add29

> ServiceLoaderFactory can't find implementations via ClassRealm
> --------------------------------------------------------------
>
>                 Key: MNG-6275
>                 URL: https://issues.apache.org/jira/browse/MNG-6275
>             Project: Maven
>          Issue Type: Bug
>          Components: Class Loading
>            Reporter: Robert Scholte
>            Assignee: Stephen Connolly
>            Priority: Critical
>              Labels: intern
>             Fix For: 4.x / Backlog
>
>
> 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).



--
This message was sent by Atlassian Jira
(v8.20.1#820001)