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

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

Paul King created GROOVY-11978:
----------------------------------

             Summary: 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


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)