You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2026/05/01 23:21:00 UTC

[jira] [Commented] (GROOVY-11978) RootLoader duplicates the core jar already on the bootstrap classpath

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

ASF GitHub Bot commented on GROOVY-11978:
-----------------------------------------

paulk-asert opened a new pull request, #2504:
URL: https://github.com/apache/groovy/pull/2504

   …trap classpath




> RootLoader duplicates the core jar already on the bootstrap classpath
> ---------------------------------------------------------------------
>
>                 Key: GROOVY-11978
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11978
>             Project: Groovy
>          Issue Type: Improvement
>            Reporter: Paul King
>            Assignee: Paul King
>            Priority: Major
>
> The launcher script puts {{groovy-x.y.z.jar}} on the JVM bootstrap {{-classpath}} so that {{GroovyStarter}} can run. {{GroovyStarter}} then reads {{groovy-starter.conf}}, whose {{load !\{groovy.home}/lib/*.jar}} glob picks up the same core jar again and adds it to the {{RootLoader}}.
> The result is that every core class is reachable via two defining loaders (the system classloader and the {{RootLoader}}), and {{ClassLoader.getResources}} returns the core jar twice. This trips the duplicate-module check in {{MetaClassRegistryImpl}}, which logs a warning on every standard launch listing the same jar URL twice.
> The fix is to skip URLs already on {{java.class.path}} when populating the {{RootLoader}} from a {{LoaderConfiguration}}, so core classes are owned by the system classloader and module/grab jars are owned by the {{RootLoader}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)