[ 
https://issues.apache.org/jira/browse/GROOVY-11978?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-11978:
-------------------------------
    Summary: RootLoader returns duplicate resource URLs when the same jar 
appears on parent and child classpaths  (was: RootLoader duplicates the core 
jar already on the bootstrap classpath)

> RootLoader returns duplicate resource URLs when the same jar appears on 
> parent and child classpaths
> ---------------------------------------------------------------------------------------------------
>
>                 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)

Reply via email to