Re: using @GrabConfig(systemClassLoader=true) in a ScriptEngine

Per Nyfelt <[email protected]> Sat, 12 Jul 2025 14:13:08 +0200
Newsgroups gmane.comp.lang.groovy.user
Organization Alipsa HB
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--------------0xhwOa6oe9Dn0j2TZ108mOOs
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Thank you, this is very helpful.

If i replace the @Grab annotations in my script (where ant will load the 
jdbc driver) with

Grape.instance.grab(classLoader:this.class.classLoader.rootLoader, [[group:'com.h2database',module:'h2',version:'2.3.232']]as Map[])

It works fine from both the groovy command line and when i use the 
GroovyStarter in my java class to run it. It does not work for 
GroovyShell (yet) but at least i got much closer to a solution.

Best regards,
Per

On 7/12/25 03:10, Nelson, Erick wrote:
>
> Not sure if this helps….
>
> I’ve programmatically loaded ivy assets using groovy.grape.Grape./grab/
>
> //
>
> //
>
> I’ve not had luck with developers remembering  the grap grab with 
> systems classloader annotations, and I got tired of answering how to 
> or pointing to docs, so I do it for them in my database connection 
> code… //
>
> Instead of my devs placing this at the top of their script…
>
> @Grapes([
>
> @GrabConfig(systemClassLoader=true),
>
> @Grab(“net.snowflake:snowflake-jdbc:3.16.1”)
>
> ])
>
> import groovy.sql.Sql
>
> I bake this in my compiled groovy class for connecting...
>
> Grape.*/instance/*.grabWithRootLoader(“net.snowflake:snowflake-jdbc:3.16.1”)
>
> see My “Grape” class below
>
> *package*script.util
>
> *import*script.Env
>
> @groovy.util.logging.Slf4j
>
> @Singleton
>
> *class*Grape {
>
> Set grapes= [] // grapes that have been loaded
>
> /**
>
> * Grab a grape using the root class loader.
>
> * This should be the same class loader as used with this GrabConfig
>
> * <p/>
>
> * <pre>
>
> * {@code @}Grapes([
>
> *     {@code @}GrabConfig(systemClassLoader=true)
>
> *     {@code @}Grab(.....)
>
> * ])
>
> * </pre>
>
> * <p/>
>
> *
>
> * *@param*grape format "group:module:version" or "property:key:default"
>
> */
>
> *void*grabWithRootLoader (String grape) {
>
>  grab(Env./script/.getClass().getClassLoader().getRootLoader(),grape)
>
>     }
>
> /**
>
> * Grab a grape using the system class loader
>
> * *@param*grape, format = "group:module:version" or "property:key:default"
>
> */
>
> *void*grabWithSystemLoader (String grape_string) {
>
> grab(Env./script/.getClass().getClassLoader()./getSystemClassLoader/(),grape_string)
>
>     }
>
> /**
>
> * Grab a grape using the _Groovy_ class loader
>
> * *@param*grape, format = "group:module:version" or "property:key:default"
>
> */
>
> *void*grabWithGroovyLoader (String grape_string) {
>
> grab(*new*groovy.lang.GroovyClassLoader(),grape_string)
>
>     }
>
> /**
>
> * Grab a grape using a class loader
>
> * *@param*classLoader
>
> * *@param*grape_string, format = "group:module:version" or 
> "property:key:default_grape_string"
>
> */
>
> *void*grab (ClassLoader classLoader, String grape_string) {
>
> *if*(!grape_string) *return*
>
> *if*(grapes.contains(grape_string)) *return*// already loaded
>
> *if*(!classLoader) classLoader= *new*groovy.lang.GroovyClassLoader()
>
> List grape= grape_string.split(//://)
>
> *if*(grape[0] == 'property') {
>
> String grape_property_key= grape[1]
>
> grape_string= Env./props/.getProperty(grape_property_key)
>
> *if*(!grape_string) {
>
> grape_string= grape.drop(2).join(':') // default_grape_string
>
> */log/*.warn("grape not defined in property [{}], using default grape 
> [{}]",grape_property_key,grape_string)
>
> }
>
> grape= grape_string.split(//://)
>
> }
>
> *def*(group, module, version) = grape
>
> *if*(grapes.contains(grape_string)) *return*// already loaded
>
> *try*{
>
> */log/*.debug("grabbing [{}] using class loader 
> [{}]",grape_string,classLoader.getClass().getName())
>
> groovy.grape.Grape./grab/(classLoader:classLoader,[[group:group,module:module,version:version]] 
> *as*Map[])
>
> grapes<< grape_string
>
> }
>
> *catch*(e) {
>
> */log/*.error("grab of [{}] using class loader [{}] failed 
> [{}]",grape_string,classLoader.getClass().getName(),e.message)
>
> }
>
>     }
>
> }
>
> *From: *Per Nyfelt <[email protected]>
> *Date: *Friday, July 11, 2025 at 11:54 AM
> *To: *users-GSC0n/0aZo1d/SJB6HiN2Ni2O/[email protected] <users-GSC0n/0aZo1d/SJB6HiN2Ni2O/[email protected]>
> *Subject: *[EXT] Re: using @GrabConfig(systemClassLoader=true) in a 
> ScriptEngine
>
> Thank you for the suggestions! I tried setting the system classloader with
>
> -Djava.system.class.loader=org.codehaus.groovy.tools.RootLoader
> and also tried
> -Djava.system.class.loader=groovy.lang.GroovyClassloader
>
> That indeed fixes the issue with "no suitable classloader available 
> for Grab" but unfortunately neither of them fixes the problem.
>
> The issue is now that ant (called via AntBuilder) is unable to find 
> the h2 jdbc driver. It looks like RootLoader is a child first 
> classloader so it "should" have worked but I guess that ant's own 
> classloader is not playing well that setup.
>
> The code is here in case anyone want to try it out: 
> https://github.com/perNyfelt/groovy-issues/tree/main/antbuilder 
> <https://secure-web.cisco.com/1Bx2GK0pQvXmkM2N8lyoS5W5TPxsShSurQWW-ab_KLN-nOcWfbH6IzoprBHWbo5Q8HmIlTIMq5GmlsWJxfh__F3Sd1S3R0z61Ep1AHqKJ_wRt9sMJCbCS6b1QneiglANZ4bE-1y07xFAK5dMw0q2Ot021HUX5dBUx9Ci5YH_xCYDNEMgrmkeDEDbbP2uYIbI9fIWJ8yd_vl35ohCyW7pcvm5pzQOrnfMLO0A7_pHvfh8DSW6c8MJ4DmTvXT0VZ1HUqhqtmYTlvoSpIhU-tf2G8O2GSTjDlme--WlVFeZaPAm7dNZKAoCQOKJv1Qr96wykFBrB_tP7GnO6IkTNSTqS7N5-Nc6a6I8OFZP_5JwQQi6KcIWJar2nX2iV-ZvMLT-AqZOM-OAULRXD1Y18VMYEGmlRFfdqcCMil5rTdLZMbXc/https%3A%2F%2Fgithub.com%2FperNyfelt%2Fgroovy-issues%2Ftree%2Fmain%2Fantbuilder>
>
> The error i am getting is as follows:
>
> [0.003s][warning][cds] Archived non-system classes are disabled 
> because the java.system.class.loader property is specified (value = 
> "org.codehaus.groovy.tools.RootLoader"). To use archived non-system 
> classes, this property must not be set
> Exception in thread "main" : Class Not Found: JDBC driver 
> org.h2.Driver could not be loaded
>         at 
> org.apache.tools.ant.taskdefs.JDBCTask.getDriver(JDBCTask.java:434)
>         at 
> org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java:365)
>         at 
> org.apache.tools.ant.taskdefs.SQLExec.getConnection(SQLExec.java:953)
>         at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:649)
>         at 
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
>         at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>         at 
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
>         at groovy.ant.AntBuilder.performTask(AntBuilder.java:347)
>         at groovy.ant.AntBuilder.nodeCompleted(AntBuilder.java:286)
>         at 
> groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:161)
>         at groovy.ant.AntBuilder.doInvokeMethod(AntBuilder.java:219)
>         at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:75)
>         at 
> org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:651)
>         at 
> org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:628)
>         at 
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:392)
>         at 
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:331)
>         at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
>         at 
> org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
>         at sqltask$_run_closure1.doCall(sqltask.groovy:9)
>         at 
> java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
>         at java.base/java.lang.reflect.Method.invoke(Method.java:580)
>         at 
> org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)
>         at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)
>         at 
> org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:280)
>         at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)
>         at groovy.lang.Closure.call(Closure.java:433)
>         at groovy.lang.Closure.call(Closure.java:422)
>         at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.with(DefaultGroovyMethods.java:368)
>         at 
> org.codehaus.groovy.runtime.DefaultGroovyMethods.with(DefaultGroovyMethods.java:313)
>         at org.codehaus.groovy.runtime.dgm$914.doMethodInvoke(Unknown 
> Source)
>         at 
> org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)
>         at sqltask.run(sqltask.groovy:7)
>         at groovy.lang.GroovyShell.evaluate(GroovyShell.java:460)
>         at groovy.lang.GroovyShell.evaluate(GroovyShell.java:504)
>         at SqlTask.main(SqlTask.java:10)
>
> I guess my best option is to mimic what the groovy command does 
> exactly and try to get that to work from java...
>
> regards,
>
> Per
>
> *Jochen Theodorou*- Wednesday, July 9, 2025 5:46:19 PM GMT+2
>
> If you run the program using the groovy command or a shell then there is
> a GroovyClassLoader involved can be used instead of the systemloader.
> Basically since Java9 Java does not use a url class loader as system
> loader anymore. Which means we cannot support systemClassLoader=true in
> case there is no rescuing GroovyClassLoader
> you could try using -Djava.system.class.loader=... to set a class loader
> using the fully qualified name. It should be a URLClassloader or child
> of it and I guess the class needs to be on the classpath as well
> The alternative is using a small program to load the classpath and start
> the program. In Groovy we are using RootLoader for this. Or you use
> GroovyStarter
> bye Jochen
>
> On 7/8/25 12:51, Per Nyfelt wrote:
>
>     Hi,
>
>     I am trying to figure out a way to
>     use @GrabConfig(systemClassLoader=true) in a ScritpEngine (or
>     GroovyShell, does not matter.
>
>     The following script works without any problem using the groovy
>     command (.e.g `groovy sqltaskExample.groovy`):
>
>     @GrabConfig(systemClassLoader=true)
>
>     @Grab('com.h2database:h2:2.3.232')
>
>     import groovy.ant.AntBuilder
>
>     println "Groovy ClassLoader: $*{*this.class.classLoader*}*"
>
>     def project = new AntBuilder()
>
>     project.with *{*
>
>     **sql(
>
>     driver: "org.h2.Driver",
>
>     url: "jdbc:h2:mem:AZ",
>
>     userid: "sa",
>
>     password: "",
>
>     // direct printed output into a text file:
>
>     output: "query.out",
>
>     print: "yes", // enable printing of result sets
>
>     showheaders:"false", // suppress column names
>
>     showtrailers:"false" // suppress "N rows returned" line
>
>     ) *{*
>
>     **transaction("""
>
>                 CREATE TABLE some_table (
>
>                   id   INT,
>
>                   name VARCHAR(200)
>
>                 );
>
>               """)
>
>     transaction("""
>
>                 INSERT INTO some_table (id, name)
>
>                 VALUES (1, 'hello');
>
>               """)
>
>     transaction("""
>
>                 SELECT name
>
>                 FROM some_table
>
>                 WHERE id = 1;
>
>               """)
>
>     *}*
>
>     **// now the file query.out contains exactly "hello"
>
>     loadfile(property: "row1col1", srcFile: "query.out")
>
>     echo(message: 'row1col1 = ${row1col1}')
>
>     delete(file: "query.out")
>
>     *}*
>
>     Calling that from java however does not work:, e.g.
>
>     public class ShellWithGrabSupport {
>
>     public static void main(String[] args) throws Exception {
>
>         GroovyScriptEngine gse = new GroovyScriptEngine(".");
>
>         gse.run("sqltaskExample.groovy", new Binding());
>
>       }
>
>     }
>
>     Results in "No Suitable classloader found for Grab"
>
>     I have tried stuff like this:
>
>     System./setProperty/("groovy.grape.enable", "true");
>
>     System./setProperty/("groovy.grape.report.downloads", "true");
>
>     GroovyClassLoader gcl = new
>     GroovyClassLoader(ClassLoader./getSystemClassLoader/());
>
>     CompilerConfiguration config = new CompilerConfiguration();
>
>     config.setRecompileGroovySource(true);
>
>     GroovyShell shell = new GroovyShell(gcl, config);
>
>     Script s = shell.parse(new File("sqltaskExample.groovy"));
>
>     s.run();
>
>     and
>
>     System./setProperty/("groovy.grape.report.downloads", "true");
>
>     System./setProperty/("groovy.grape.enable", "true");
>
>     // Ensure system classloader is used
>
>     Thread./currentThread/().setContextClassLoader(ClassLoader./getSystemClassLoader/());
>
>     // This mimics what the `groovy` CLI does
>
>     GroovyMain./main/(new String[]{"sqltaskExample.groovy"});
>
>     All with the same result.
>
>
>     I use the following to bootstrap java:
>
>     gl="$GROOVY_HOME/lib"
>
>     v="4.0.27"
>
>     cp="$gl/groovy-$v.jar:$gl/groovy-ant-$v.jar:$gl/groovy-ant-$v.jar:$gl/ant-1.10.15.jar:\
>
>     $gl/ant-launcher-1.10.15.jar:$gl/ivy-2.5.3.jar"
>
>     java -cp "$cp" ShellWithGrabSupport.java
>
>     So since ant is loaded by the system classloader, I must
>     use @GrabConfig(systemClassLoader=true) in the groovy script for
>     the jdbc driver, otherwise the sql ant task will not be able to
>     find it.
>
>     This minimum, reproducible example is here:
>     https://github.com/perNyfelt/groovy-issues/tree/main/grabconfig
>     <https://secure-web.cisco.com/1In-4b3_kzgWRocKvIlRp522Qr7T5nJ8OLk87IATlUz8-gcWUthaRCh0X0vCNZLB3VN8mZ1KQgTB6ncGl8MPCgIj8GiNm6l-CMGFX9aDFgkYJ6USEMT-O3oaIv6ho_9-BqmK9KNOEuk_pZ3dg6dKBnihk7bW_27BFRpD780XfN5m0SyDyIAEwlL7z_IJTYoh5wheti2xBYdNvUkEgevL-Yqotv7r_bT1LF6qnDFJX6iiN8CzQ285ngU65QyRhZQAqIfTUoGqq3yJ8f1IlK_0QFOOvgkdmi3VfgNrPF0oDWFR_kUQK-JeA2zQsIc2WhLS_569RgelvhftCSGGib5VCIdijIlgKmsiNKrMw83d3eSOhU7jHp4ba0aljnMU_VopgMuTapABIU-veEZKxFI5HY98GcHQgE3gQRF1UxYvln40/https%3A%2F%2Fgithub.com%2FperNyfelt%2Fgroovy-issues%2Ftree%2Fmain%2Fgrabconfig>
>
>     The details of the error are as follows:
>     Exception in thread "main"
>     org.codehaus.groovy.control.MultipleCompilationErrorsException:
>     startup failed:
>     General error during conversion: No suitable ClassLoader found for
>     grab
>
>     java.lang.RuntimeException: No suitable ClassLoader found for grab
>             at
>     groovy.grape.GrapeIvy.chooseClassLoader(GrapeIvy.groovy:179)
>             at groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:273)
>             at groovy.grape.Grape$1.run(Grape.java:172)
>             at groovy.grape.Grape$1.run(Grape.java:158)
>             at
>     java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
>             at groovy.grape.Grape.grab(Grape.java:158)
>             at
>     groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:380)
>             at
>     org.codehaus.groovy.transform.ASTTransformationVisitor.lambda$addPhaseOperationsForGlobalTransforms$5(ASTTransformationVisitor.java:374)
>             at
>     org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:906)
>             at
>     org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:701)
>             at
>     org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:675)
>             at
>     groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:365)
>             at
>     groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:314)
>             at
>     org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
>             at
>     org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
>             at
>     groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:314)
>             at
>     groovy.util.GroovyScriptEngine$ScriptClassLoader.doParseClass(GroovyScriptEngine.java:231)
>             at
>     groovy.util.GroovyScriptEngine$ScriptClassLoader.parseClass(GroovyScriptEngine.java:218)
>             at
>     groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:298)
>             at
>     groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:263)
>             at
>     groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.java:534)
>             at
>     groovy.util.GroovyScriptEngine.createScript(GroovyScriptEngine.java:584)
>             at
>     groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:571)
>             at ShellWithGrabSupport.main(ShellWithGrabSupport.java:7)
>             at
>
>     ...
>
>     Does anyone know a way?
>
--------------0xhwOa6oe9Dn0j2TZ108mOOs
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thank you, this is very helpful.</p>
    <p>If i replace the @Grab annotations in my script (where ant will
      load the jdbc driver) with <br>
    </p>
    <div style="background-color:#1e1f22;color:#bcbec4">
      <pre
      style="font-family:'JetBrains Mono',monospace;font-size:10.5pt;">Grape.<span
      style="color:#c77dba;font-style:italic;">instance</span>.grab(<span
      style="color:#6aab73;">classLoader</span>: <span
      style="color:#cf8e6d;">this</span>.<span style="color:#c77dbb;">class</span>.<span
      style="color:#c77dbb;">classLoader</span>.<span
      style="color:#c77dbb;">rootLoader</span>, [[<span
      style="color:#6aab73;">group</span>:<span style="color:#6aab73;">'com.h2database'</span>,<span
      style="color:#6aab73;">module</span>:<span style="color:#6aab73;">'h2'</span>,<span
      style="color:#6aab73;">version</span>:<span style="color:#6aab73;">'2.3.232'</span>]] <span
      style="color:#cf8e6d;">as </span>Map[])</pre>
    </div>
    <p></p>
    <div class="moz-cite-prefix">It works fine from both the groovy
      command line and when i use the GroovyStarter in my java class to
      run it. It does not work for GroovyShell (yet) but at least i got
      much closer to a solution.</div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">Best regards,</div>
    <div class="moz-cite-prefix">Per<br>
    </div>
    <div class="moz-cite-prefix"><br>
    </div>
    <div class="moz-cite-prefix">On 7/12/25 03:10, Nelson, Erick wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:BN0PR13MB51015D074262A7F75C08A788E74AA-Bgy8O0B/GHcFVWf+fw+AG/[email protected]">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <meta name="Generator"
        content="Microsoft Word 15 (filtered medium)">
      <style>@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
	{font-family:Aptos;
	panose-1:2 11 0 4 2 2 2 2 2 4;}@font-face
	{font-family:Consolas;
	panose-1:2 11 6 9 2 2 4 3 2 4;}@font-face
	{font-family:Hack;
	panose-1:2 11 6 4 2 2 2 2 2 4;}@font-face
	{font-family:"Andale Mono";
	panose-1:2 11 5 9 0 0 0 0 0 4;}@font-face
	{font-family:Menlo;
	panose-1:2 11 6 9 3 8 4 2 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	font-size:10.0pt;
	font-family:"Aptos",sans-serif;}a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}pre
	{mso-style-priority:99;
	mso-style-link:"HTML Preformatted Char";
	margin:0in;
	font-size:10.0pt;
	font-family:"Courier New";}span.HTMLPreformattedChar
	{mso-style-name:"HTML Preformatted Char";
	mso-style-priority:99;
	mso-style-link:"HTML Preformatted";
	font-family:Consolas;}.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;
	mso-ligatures:none;}div.WordSection1
	{page:WordSection1;}</style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size:11.0pt">Not sure if
            this helps….<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">I’ve
            programmatically loaded ivy assets using  </span><span
style="font-size:8.0pt;font-family:Menlo;color:black;background:yellow;mso-highlight:yellow">groovy.grape.Grape.<i>grab</i></span><span
            style="font-size:11.0pt"><o:p></o:p></span></p>
        <p class="MsoNormal"><i><span
              style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></i></p>
        <p class="MsoNormal"><i><span
              style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></i></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">I’ve not had
            luck with developers remembering  the grap grab with systems
            classloader annotations, and I got tired of answering how to
            or pointing to docs, so I do it for them in my database
            connection code…
          </span><i><span
              style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></i></p>
        <p class="MsoNormal"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Instead of
            my devs placing this at the top of their script…<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;">@Grapes([<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;"> 
            @GrabConfig(systemClassLoader=true),<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;"> 
            @Grab(“</span><span
style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;;color:black;background:white">net.snowflake:snowflake-jdbc:3.16.1”</span><span
            style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;">)<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;">])<o:p></o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;">import
            groovy.sql.Sql<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">I bake this
            in my compiled groovy class for connecting...<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;;color:black;background:white">Grape.</span><b><i><span
style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;;color:#0000C0;background:white">instance</span></i></b><span
style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;;color:black;background:white">.grabWithRootLoader(“net.snowflake:snowflake-jdbc:3.16.1”)<o:p></o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;;color:black;background:white"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
style="font-size:14.0pt;font-family:&quot;Andale Mono&quot;;color:black;background:white"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:11.0pt;font-family:&quot;Andale Mono&quot;"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">see My
            “Grape” class below<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">package</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            script.util<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">import</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            script.Env<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#646464">@groovy.util.logging.Slf4j</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#646464">@Singleton</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">class</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> Grape
            {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
            Set
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#0000C0">grapes</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> = []
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F7F5F">//
            grapes that have been loaded</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">/**</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * Grab a grape using the root class loader.</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * This should be the same class loader as used with this
            GrabConfig</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * &lt;p/&gt;</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#7F7F9F">&lt;pre&gt;</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * {@code @}Grapes([</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *     {@code @}GrabConfig(systemClassLoader=true)</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *     {@code @}Grab(.....)</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * ])</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#7F7F9F">&lt;/pre&gt;</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * &lt;p/&gt;</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F9FBF">@param</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">
            grape format "group:module:version" or
            "property:key:default"</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            */</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">void</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            grabWithRootLoader (String
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">) {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">      
             grab(Env.</span><i><span
              style="font-size:8.0pt;font-family:Menlo;color:#0000C0">script</span></i><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.getClass().getClassLoader().</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#FF00CC">getRootLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">(),</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">    }<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">/**</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * Grab a grape using the system class loader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F9FBF">@param</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">
            grape, format = "group:module:version" or
            "property:key:default"</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            */</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">void</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            grabWithSystemLoader (String
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">) {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
            grab(Env.</span><i><span
              style="font-size:8.0pt;font-family:Menlo;color:#0000C0">script</span></i><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.getClass().getClassLoader().<i>getSystemClassLoader</i>(),</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">    }<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">/**</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * Grab a grape using the
            <u>Groovy</u> class loader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F9FBF">@param</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">
            grape, format = "group:module:version" or
            "property:key:default"</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            */</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">void</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            grabWithGroovyLoader (String
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">) {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
            grab(</span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">new</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            groovy.lang.GroovyClassLoader(),</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">    }<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">/**</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            * Grab a grape using a class loader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F9FBF">@param</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">
            classLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            *
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F9FBF">@param</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">
            grape_string, format = "group:module:version" or
            "property:key:default_grape_string"</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F5FBF">    
            */</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">void</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> grab
            (ClassLoader
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">classLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,
            String
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">) {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">if</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> (!</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">return</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">if</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> (</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#0000C0">grapes</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.contains(</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">))
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">return</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F7F5F">//
            already loaded</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">if</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> (!</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">classLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">classLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> =
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">new</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            groovy.lang.GroovyClassLoader()<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
            List
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> =
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.split(</span><i><span
              style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">/:/</span></i><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">if</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> (</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">[0] ==
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">'property'</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">) {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
            String
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_property_key</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> =
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">[1]<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> =
            Env.</span><i><span
              style="font-size:8.0pt;font-family:Menlo;color:#0000C0">props</span></i><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.getProperty(</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_property_key</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">if</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> (!</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">) {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">               
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> =
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#FF00CC">drop</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">(2).</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#FF00CC">join</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">(</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">':'</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F7F5F">//
            default_grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">               
          </span><b><i><span
                style="font-size:8.0pt;font-family:Menlo;color:#0000C0">log</span></i></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.warn(</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">"grape
            not defined in property [{}], using default grape [{}]"</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_property_key</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
            }<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> =
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.split(</span><i><span
              style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">/:/</span></i><span
            style="font-size:8.0pt;font-family:Menlo;color:black">)<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
            }<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">def</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> (</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">group</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">module</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">version</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">) =
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">if</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> (</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#0000C0">grapes</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.contains(</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">))
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">return</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#3F7F5F">//
            already loaded</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">try</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
          </span><b><i><span
                style="font-size:8.0pt;font-family:Menlo;color:#0000C0">log</span></i></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.debug(</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">"grabbing
            [{}] using class loader [{}]"</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">classLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.getClass().getName())<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
            <span style="background:yellow;mso-highlight:yellow">groovy.grape.Grape.<i>grab</i></span>(</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">classLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">:</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">classLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,[[</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">group</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">:</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">group</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">module</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">:</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">module</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">version</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">:</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">version</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">]]
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">as</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            Map[])<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#0000C0">grapes</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">
            &lt;&lt;
          </span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black"><o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
            }<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
          </span><b><span
              style="font-size:8.0pt;font-family:Menlo;color:#7F0055">catch</span></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black"> (</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">e</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">) {<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">           
          </span><b><i><span
                style="font-size:8.0pt;font-family:Menlo;color:#0000C0">log</span></i></b><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.error(</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#2A00FF">"grab
            of [{}] using class loader [{}] failed [{}]"</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">grape_string</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">,</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">classLoader</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.getClass().getName(),</span><span
            style="font-size:8.0pt;font-family:Menlo;color:#6A3E3E">e</span><span
            style="font-size:8.0pt;font-family:Menlo;color:black">.message)<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">       
            }<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">    }<o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">   
            <o:p></o:p></span></p>
        <p class="MsoNormal" style="background:white"><span
            style="font-size:8.0pt;font-family:Menlo;color:black">}<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <div id="mail-editor-reference-message-container">
          <div>
            <div>
              <div
style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
                <p class="MsoNormal" style="margin-bottom:12.0pt"><b><span
                      style="font-size:12.0pt;color:black">From:
                    </span></b><span
                    style="font-size:12.0pt;color:black">Per Nyfelt
                    <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a><br>
                    <b>Date: </b>Friday, July 11, 2025 at 11:54</span><span
style="font-size:12.0pt;font-family:&quot;Arial&quot;,sans-serif;color:black"> </span><span
                    style="font-size:12.0pt;color:black">AM<br>
                    <b>To: </b><a class="moz-txt-link-abbreviated" href="mailto:users-GSC0n/0aZo1d/SJB6HiN2Ni2O/[email protected]">users-GSC0n/0aZo1d/SJB6HiN2Ni2O/[email protected]</a>
                    <a class="moz-txt-link-rfc2396E" href="mailto:users-GSC0n/0aZo1d/SJB6HiN2Ni2O/[email protected]">&lt;users-GSC0n/0aZo1d/SJB6HiN2Ni2O/[email protected]&gt;</a><br>
                    <b>Subject: </b>[EXT] Re: using
                    @GrabConfig(systemClassLoader=true) in a
                    ScriptEngine<o:p></o:p></span></p>
              </div>
              <p>Thank you for the suggestions! I tried setting the
                system classloader with</p>
              <pre><span style="font-size:10.5pt">-Djava.system.class.loader=org.codehaus.groovy.tools.RootLoader <o:p></o:p></span></pre>
              <pre><span style="font-size:10.5pt">and also tried<o:p></o:p></span></pre>
              <div>
                <pre style="background:#1E1F22"><span
                style="font-size:10.5pt;color:#BCBEC4">-Djava.system.class.loader=groovy.lang.GroovyClassloader<o:p></o:p></span></pre>
              </div>
              <p>That indeed fixes the issue with "no suitable
                classloader available for Grab" but unfortunately
                neither of them fixes the problem.</p>
              <p>The issue is now that ant (called via AntBuilder) is
                unable to find the h2 jdbc driver. It looks like
                RootLoader is a child first classloader so it "should"
                have worked but I guess that ant's own classloader is
                not playing well that setup.</p>
              <p>The code is here in case anyone want to try it out: <a
href="https://secure-web.cisco.com/1Bx2GK0pQvXmkM2N8lyoS5W5TPxsShSurQWW-ab_KLN-nOcWfbH6IzoprBHWbo5Q8HmIlTIMq5GmlsWJxfh__F3Sd1S3R0z61Ep1AHqKJ_wRt9sMJCbCS6b1QneiglANZ4bE-1y07xFAK5dMw0q2Ot021HUX5dBUx9Ci5YH_xCYDNEMgrmkeDEDbbP2uYIbI9fIWJ8yd_vl35ohCyW7pcvm5pzQOrnfMLO0A7_pHvfh8DSW6c8MJ4DmTvXT0VZ1HUqhqtmYTlvoSpIhU-tf2G8O2GSTjDlme--WlVFeZaPAm7dNZKAoCQOKJv1Qr96wykFBrB_tP7GnO6IkTNSTqS7N5-Nc6a6I8OFZP_5JwQQi6KcIWJar2nX2iV-ZvMLT-AqZOM-OAULRXD1Y18VMYEGmlRFfdqcCMil5rTdLZMbXc/https%3A%2F%2Fgithub.com%2FperNyfelt%2Fgroovy-issues%2Ftree%2Fmain%2Fantbuilder"
                  moz-do-not-send="true">
https://github.com/perNyfelt/groovy-issues/tree/main/antbuilder</a></p>
              <p>The error i am getting is as follows:</p>
              <p style="margin-bottom:12.0pt">[0.003s][warning][cds]
                Archived non-system classes are disabled because the
                java.system.class.loader property is specified (value =
                "org.codehaus.groovy.tools.RootLoader"). To use archived
                non-system classes, this property must not be set<br>
                Exception in thread "main" : Class Not Found: JDBC
                driver org.h2.Driver could not be loaded<br>
                        at
                org.apache.tools.ant.taskdefs.JDBCTask.getDriver(JDBCTask.java:434)<br>
                        at
                org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java:365)<br>
                        at
                org.apache.tools.ant.taskdefs.SQLExec.getConnection(SQLExec.java:953)<br>
                        at
                org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:649)<br>
                        at
                org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)<br>
                        at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)<br>
                        at
                java.base/java.lang.reflect.Method.invoke(Method.java:580)<br>
                        at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)<br>
                        at
                groovy.ant.AntBuilder.performTask(AntBuilder.java:347)<br>
                        at
                groovy.ant.AntBuilder.nodeCompleted(AntBuilder.java:286)<br>
                        at
                groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:161)<br>
                        at
                groovy.ant.AntBuilder.doInvokeMethod(AntBuilder.java:219)<br>
                        at
                groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:75)<br>
                        at
org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:651)<br>
                        at
org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:628)<br>
                        at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeOnDelegationObjects(ClosureMetaClass.java:392)<br>
                        at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:331)<br>
                        at
                groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)<br>
                        at
org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)<br>
                        at
                sqltask$_run_closure1.doCall(sqltask.groovy:9)<br>
                        at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)<br>
                        at
                java.base/java.lang.reflect.Method.invoke(Method.java:580)<br>
                        at
org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:343)<br>
                        at
                groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:328)<br>
                        at
org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:280)<br>
                        at
                groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1007)<br>
                        at groovy.lang.Closure.call(Closure.java:433)<br>
                        at groovy.lang.Closure.call(Closure.java:422)<br>
                        at
org.codehaus.groovy.runtime.DefaultGroovyMethods.with(DefaultGroovyMethods.java:368)<br>
                        at
org.codehaus.groovy.runtime.DefaultGroovyMethods.with(DefaultGroovyMethods.java:313)<br>
                        at
                org.codehaus.groovy.runtime.dgm$914.doMethodInvoke(Unknown
                Source)<br>
                        at
org.codehaus.groovy.vmplugin.v8.IndyInterface.fromCache(IndyInterface.java:321)<br>
                        at sqltask.run(sqltask.groovy:7)<br>
                        at
                groovy.lang.GroovyShell.evaluate(GroovyShell.java:460)<br>
                        at
                groovy.lang.GroovyShell.evaluate(GroovyShell.java:504)<br>
                        at SqlTask.main(SqlTask.java:10)</p>
              <p>I guess my best option is to mimic what the groovy
                command does exactly and try to get that to work from
                java...</p>
              <p>regards,</p>
              <p>Per</p>
              <div>
                <div>
                  <p class="MsoNormal"
                    style="line-height:27.0pt;background:#337AB7"><b><span
style="font-size:9.5pt;font-family:&quot;Arial&quot;,sans-serif;color:white">Jochen
                        Theodorou</span></b><span
style="font-size:9.5pt;font-family:&quot;Arial&quot;,sans-serif;color:white">
                      - Wednesday, July 9, 2025 5:46:19 PM GMT+2<o:p></o:p></span></p>
                </div>
              </div>
              <div>
                <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
                style="font-family:&quot;Hack&quot;,serif;color:#222233"><o:p> </o:p></span></pre>
              </div>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">If you run the program using the groovy command or a shell then there is<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">a GroovyClassLoader involved can be used instead of the systemloader.<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233"><o:p> </o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">Basically since Java9 Java does not use a url class loader as system<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">loader anymore. Which means we cannot support systemClassLoader=true in<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">case there is no rescuing GroovyClassLoader<o:p></o:p></span></pre>
              <div>
                <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
                style="font-family:&quot;Hack&quot;,serif;color:#222233"><o:p> </o:p></span></pre>
              </div>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">you could try using -Djava.system.class.loader=... to set a class loader<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">using the fully qualified name. It should be a URLClassloader or child<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">of it and I guess the class needs to be on the classpath as well<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233"><o:p> </o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">The alternative is using a small program to load the classpath and start<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">the program. In Groovy we are using RootLoader for this. Or you use<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">GroovyStarter<o:p></o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233"><o:p> </o:p></span></pre>
              <pre
style="mso-margin-top-alt:7.5pt;margin-right:7.5pt;margin-bottom:18.75pt;margin-left:15.0pt;background:white"><span
              style="font-family:&quot;Hack&quot;,serif;color:#222233">bye Jochen<o:p></o:p></span></pre>
              <p><o:p> </o:p></p>
              <div>
                <p class="MsoNormal"><span style="font-size:12.0pt">On
                    7/8/25 12:51, Per Nyfelt wrote:<o:p></o:p></span></p>
              </div>
              <blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
                <div>
                  <p class="MsoNormal"><span style="font-size:12.0pt">Hi, 
                      <o:p></o:p></span></p>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">I
                        am trying to figure out a way to
                        use @GrabConfig(systemClassLoader=true) in a
                        ScritpEngine (or GroovyShell, does not matter.<o:p></o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-bottom:12.0pt"><span
                        style="font-size:12.0pt">The following script
                        works without any problem using the groovy
                        command (.e.g `groovy sqltaskExample.groovy`):<o:p></o:p></span></p>
                    <div>
                      <pre style="background:#1E1F22"><span
                      style="color:#B3AE60">@GrabConfig</span><span
                      style="color:#BCBEC4">(systemClassLoader=</span><span
                      style="color:#CF8E6D">true</span><span
                      style="color:#BCBEC4">)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#B3AE60">@Grab</span><span
                      style="color:#BCBEC4">(</span><span
                      style="color:#6AAB73">'com.h2database:h2:2.3.232'</span><span
                      style="color:#BCBEC4">)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#CF8E6D">import </span><span
                      style="color:#BCBEC4">groovy.ant.AntBuilder<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4"><o:p> </o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">println </span><span
                      style="color:#6AAB73">"Groovy ClassLoader: </span><span
                      style="color:#BCBEC4">$<b>{</b></span><span
                      style="color:#CF8E6D">this</span><span
                      style="color:#BCBEC4">.</span><span
                      style="color:#C77DBB">class</span><span
                      style="color:#BCBEC4">.</span><span
                      style="color:#C77DBB">classLoader</span><b><span
                      style="color:#BCBEC4">}</span></b><span
                      style="color:#6AAB73">"<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#CF8E6D">def </span><span
                      style="color:#BCBEC4">project = </span><span
                      style="color:#CF8E6D">new </span><span
                      style="color:#BCBEC4">AntBuilder()<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">project.</span><span
                      style="color:#757A85">with </span><b><span
                      style="color:#BCBEC4">{<o:p></o:p></span></b></pre>
                      <pre style="background:#1E1F22"><b><span
                      style="color:#BCBEC4">  </span></b><span
                      style="color:#757A85">sql</span><span
                      style="color:#BCBEC4">(<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">      </span><span
                      style="color:#6AAB73">driver</span><span
                      style="color:#BCBEC4">:     </span><span
                      style="color:#6AAB73">"org.h2.Driver"</span><span
                      style="color:#BCBEC4">,<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">      </span><span
                      style="color:#6AAB73">url</span><span
                      style="color:#BCBEC4">:        </span><span
                      style="color:#6AAB73">"jdbc:h2:mem:AZ"</span><span
                      style="color:#BCBEC4">,<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">      </span><span
                      style="color:#6AAB73">userid</span><span
                      style="color:#BCBEC4">:     </span><span
                      style="color:#6AAB73">"sa"</span><span
                      style="color:#BCBEC4">,<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">      </span><span
                      style="color:#6AAB73">password</span><span
                      style="color:#BCBEC4">:   </span><span
                      style="color:#6AAB73">""</span><span
                      style="color:#BCBEC4">,<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">      </span><span
                      style="color:#7A7E85">// direct printed output into a text file:<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#7A7E85">      </span><span
                      style="color:#6AAB73">output</span><span
                      style="color:#BCBEC4">:     </span><span
                      style="color:#6AAB73">"query.out"</span><span
                      style="color:#BCBEC4">,<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">      </span><span
                      style="color:#6AAB73">print</span><span
                      style="color:#BCBEC4">:      </span><span
                      style="color:#6AAB73">"yes"</span><span
                      style="color:#BCBEC4">,      </span><span
                      style="color:#7A7E85">// enable printing of result sets<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#7A7E85">      </span><span
                      style="color:#6AAB73">showheaders</span><span
                      style="color:#BCBEC4">:</span><span
                      style="color:#6AAB73">"false"</span><span
                      style="color:#BCBEC4">,    </span><span
                      style="color:#7A7E85">// suppress column names<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#7A7E85">      </span><span
                      style="color:#6AAB73">showtrailers</span><span
                      style="color:#BCBEC4">:</span><span
                      style="color:#6AAB73">"false"    </span><span
                      style="color:#7A7E85">// suppress "N rows returned" line<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#7A7E85">  </span><span
                      style="color:#BCBEC4">) <b>{<o:p></o:p></b></span></pre>
                      <pre style="background:#1E1F22"><b><span
                      style="color:#BCBEC4">    </span></b><span
                      style="color:#757A85">transaction</span><span
                      style="color:#BCBEC4">(</span><span
                      style="color:#6AAB73">"""<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">            CREATE TABLE some_table (<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">              id   INT,<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">              name VARCHAR(200)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">            );<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">          """</span><span
                      style="color:#BCBEC4">)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">    </span><span
                      style="color:#757A85">transaction</span><span
                      style="color:#BCBEC4">(</span><span
                      style="color:#6AAB73">"""<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">            INSERT INTO some_table (id, name)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">            VALUES (1, 'hello');<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">          """</span><span
                      style="color:#BCBEC4">)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">    </span><span
                      style="color:#757A85">transaction</span><span
                      style="color:#BCBEC4">(</span><span
                      style="color:#6AAB73">"""<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">            SELECT name<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">            FROM some_table<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">            WHERE id = 1;<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#6AAB73">          """</span><span
                      style="color:#BCBEC4">)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">  <b>}<o:p></o:p></b></span></pre>
                      <pre style="background:#1E1F22"><b><span
                      style="color:#BCBEC4">  </span></b><span
                      style="color:#7A7E85">// now the file query.out contains exactly "hello"<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#7A7E85">  </span><span
                      style="color:#757A85">loadfile</span><span
                      style="color:#BCBEC4">(</span><span
                      style="color:#6AAB73">property</span><span
                      style="color:#BCBEC4">: </span><span
                      style="color:#6AAB73">"row1col1"</span><span
                      style="color:#BCBEC4">, </span><span
                      style="color:#6AAB73">srcFile</span><span
                      style="color:#BCBEC4">: </span><span
                      style="color:#6AAB73">"query.out"</span><span
                      style="color:#BCBEC4">)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">  </span><span
                      style="color:#757A85">echo</span><span
                      style="color:#BCBEC4">(</span><span
                      style="color:#6AAB73">message</span><span
                      style="color:#BCBEC4">: </span><span
                      style="color:#6AAB73">'row1col1 = ${row1col1}'</span><span
                      style="color:#BCBEC4">)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">  </span><span
                      style="color:#757A85">delete</span><span
                      style="color:#BCBEC4">(</span><span
                      style="color:#6AAB73">file</span><span
                      style="color:#BCBEC4">: </span><span
                      style="color:#6AAB73">"query.out"</span><span
                      style="color:#BCBEC4">)<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><b><span
                      style="color:#BCBEC4">}</span></b><span
                      style="color:#BCBEC4"><o:p></o:p></span></pre>
                    </div>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">Calling
                        that from java however does not work:, e.g.<o:p></o:p></span></p>
                    <div>
                      <pre style="background:#1E1F22"><span
                      style="color:#CF8E6D">public class </span><span
                      style="color:#BCBEC4">ShellWithGrabSupport {<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">  </span><span
                      style="color:#CF8E6D">public static void </span><span
                      style="color:#56A8F5">main</span><span
                      style="color:#BCBEC4">(String[] args) </span><span
                      style="color:#CF8E6D">throws </span><span
                      style="color:#BCBEC4">Exception {<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">    GroovyScriptEngine gse = </span><span
                      style="color:#CF8E6D">new </span><span
                      style="color:#BCBEC4">GroovyScriptEngine(</span><span
                      style="color:#6AAB73">"."</span><span
                      style="color:#BCBEC4">);<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">    gse.run(</span><span
                      style="color:#6AAB73">"sqltaskExample.groovy"</span><span
                      style="color:#BCBEC4">, </span><span
                      style="color:#CF8E6D">new </span><span
                      style="color:#BCBEC4">Binding());<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">  }<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">}<o:p></o:p></span></pre>
                    </div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">Results
                        in "No Suitable classloader found for Grab"<o:p></o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">I
                        have tried stuff like this:<o:p></o:p></span></p>
                    <div>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">System.<i>setProperty</i>(</span><span
                      style="color:#6AAB73">"groovy.grape.enable"</span><span
                      style="color:#BCBEC4">, </span><span
                      style="color:#6AAB73">"true"</span><span
                      style="color:#BCBEC4">);<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">System.<i>setProperty</i>(</span><span
                      style="color:#6AAB73">"groovy.grape.report.downloads"</span><span
                      style="color:#BCBEC4">, </span><span
                      style="color:#6AAB73">"true"</span><span
                      style="color:#BCBEC4">);<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">GroovyClassLoader gcl = </span><span
                      style="color:#CF8E6D">new </span><span
                      style="color:#BCBEC4">GroovyClassLoader(ClassLoader.<i>getSystemClassLoader</i>());<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4"><o:p> </o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">CompilerConfiguration config = </span><span
                      style="color:#CF8E6D">new </span><span
                      style="color:#BCBEC4">CompilerConfiguration();<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">config.setRecompileGroovySource(</span><span
                      style="color:#CF8E6D">true</span><span
                      style="color:#BCBEC4">);<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4"><o:p> </o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">GroovyShell shell = </span><span
                      style="color:#CF8E6D">new </span><span
                      style="color:#BCBEC4">GroovyShell(gcl, config);<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">Script s = shell.parse(</span><span
                      style="color:#CF8E6D">new </span><span
                      style="color:#BCBEC4">File(</span><span
                      style="color:#6AAB73">"sqltaskExample.groovy"</span><span
                      style="color:#BCBEC4">));<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">s.run();<o:p></o:p></span></pre>
                    </div>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">and<o:p></o:p></span></p>
                  </div>
                  <div>
                    <div>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">System.<i>setProperty</i>(</span><span
                      style="color:#6AAB73">"groovy.grape.report.downloads"</span><span
                      style="color:#BCBEC4">, </span><span
                      style="color:#6AAB73">"true"</span><span
                      style="color:#BCBEC4">);<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">System.<i>setProperty</i>(</span><span
                      style="color:#6AAB73">"groovy.grape.enable"</span><span
                      style="color:#BCBEC4">, </span><span
                      style="color:#6AAB73">"true"</span><span
                      style="color:#BCBEC4">);<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#7A7E85">// Ensure system classloader is used<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">Thread.<i>currentThread</i>().setContextClassLoader(ClassLoader.<i>getSystemClassLoader</i>());<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4"><o:p> </o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#7A7E85">// This mimics what the `groovy` CLI does<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">GroovyMain.<i>main</i>(</span><span
                      style="color:#CF8E6D">new </span><span
                      style="color:#BCBEC4">String[]{</span><span
                      style="color:#6AAB73">"sqltaskExample.groovy"</span><span
                      style="color:#BCBEC4">});<o:p></o:p></span></pre>
                    </div>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">All
                        with the same result. <o:p></o:p></span></p>
                  </div>
                  <p class="MsoNormal"><span style="font-size:12.0pt"><br>
                      I use the following to bootstrap java: <o:p></o:p></span></p>
                  <div>
                    <div>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">gl=</span><span
                      style="color:#6AAB73">"</span><span
                      style="color:#BCBEC4">$GROOVY_HOME</span><span
                      style="color:#6AAB73">/lib"<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">v=</span><span
                      style="color:#6AAB73">"4.0.27"<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">cp=</span><span
                      style="color:#6AAB73">"</span><span
                      style="color:#BCBEC4">$gl</span><span
                      style="color:#6AAB73">/groovy-</span><span
                      style="color:#BCBEC4">$v</span><span
                      style="color:#6AAB73">.jar:</span><span
                      style="color:#BCBEC4">$gl</span><span
                      style="color:#6AAB73">/groovy-ant-</span><span
                      style="color:#BCBEC4">$v</span><span
                      style="color:#6AAB73">.jar:</span><span
                      style="color:#BCBEC4">$gl</span><span
                      style="color:#6AAB73">/groovy-ant-</span><span
                      style="color:#BCBEC4">$v</span><span
                      style="color:#6AAB73">.jar:</span><span
                      style="color:#BCBEC4">$gl</span><span
                      style="color:#6AAB73">/ant-1.10.15.jar:\<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#BCBEC4">$gl</span><span
                      style="color:#6AAB73">/ant-launcher-1.10.15.jar:</span><span
                      style="color:#BCBEC4">$gl</span><span
                      style="color:#6AAB73">/ivy-2.5.3.jar"<o:p></o:p></span></pre>
                      <pre style="background:#1E1F22"><span
                      style="color:#C57633">java </span><span
                      style="color:#BCBEC4">-cp </span><span
                      style="color:#6AAB73">"</span><span
                      style="color:#BCBEC4">$cp</span><span
                      style="color:#6AAB73">" </span><span
                      style="color:#BCBEC4">ShellWithGrabSupport.java<o:p></o:p></span></pre>
                    </div>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">So
                        since ant is loaded by the system classloader, I
                        must use @GrabConfig(systemClassLoader=true) in
                        the groovy script for the jdbc driver, otherwise
                        the sql ant task will not be able to find it.<o:p></o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">This
                        minimum, reproducible example is here: </span><a
href="https://secure-web.cisco.com/1In-4b3_kzgWRocKvIlRp522Qr7T5nJ8OLk87IATlUz8-gcWUthaRCh0X0vCNZLB3VN8mZ1KQgTB6ncGl8MPCgIj8GiNm6l-CMGFX9aDFgkYJ6USEMT-O3oaIv6ho_9-BqmK9KNOEuk_pZ3dg6dKBnihk7bW_27BFRpD780XfN5m0SyDyIAEwlL7z_IJTYoh5wheti2xBYdNvUkEgevL-Yqotv7r_bT1LF6qnDFJX6iiN8CzQ285ngU65QyRhZQAqIfTUoGqq3yJ8f1IlK_0QFOOvgkdmi3VfgNrPF0oDWFR_kUQK-JeA2zQsIc2WhLS_569RgelvhftCSGGib5VCIdijIlgKmsiNKrMw83d3eSOhU7jHp4ba0aljnMU_VopgMuTapABIU-veEZKxFI5HY98GcHQgE3gQRF1UxYvln40/https%3A%2F%2Fgithub.com%2FperNyfelt%2Fgroovy-issues%2Ftree%2Fmain%2Fgrabconfig"
                        moz-do-not-send="true"><span
                          style="font-size:12.0pt">https://github.com/perNyfelt/groovy-issues/tree/main/grabconfig</span></a><span
                        style="font-size:12.0pt"><o:p></o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">The
                        details of the error are as follows:<br>
                        Exception in thread "main"
                        org.codehaus.groovy.control.MultipleCompilationErrorsException:
                        startup failed:<br>
                        General error during conversion: No suitable
                        ClassLoader found for grab<br>
                        <br>
                        java.lang.RuntimeException: No suitable
                        ClassLoader found for grab<br>
                                at
                        groovy.grape.GrapeIvy.chooseClassLoader(GrapeIvy.groovy:179)<br>
                                at
                        groovy.grape.GrapeIvy.grab(GrapeIvy.groovy:273)<br>
                                at
                        groovy.grape.Grape$1.run(Grape.java:172)<br>
                                at
                        groovy.grape.Grape$1.run(Grape.java:158)<br>
                                at
java.base/java.security.AccessController.doPrivileged(AccessController.java:319)<br>
                                at
                        groovy.grape.Grape.grab(Grape.java:158)<br>
                                at
groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:380)<br>
                                at
org.codehaus.groovy.transform.ASTTransformationVisitor.lambda$addPhaseOperationsForGlobalTransforms$5(ASTTransformationVisitor.java:374)<br>
                                at
org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:906)<br>
                                at
org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:701)<br>
                                at
org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:675)<br>
                                at
                        groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:365)<br>
                                at
groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:314)<br>
                                at
org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)<br>
                                at
org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)<br>
                                at
                        groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:314)<br>
                                at
groovy.util.GroovyScriptEngine$ScriptClassLoader.doParseClass(GroovyScriptEngine.java:231)<br>
                                at
groovy.util.GroovyScriptEngine$ScriptClassLoader.parseClass(GroovyScriptEngine.java:218)<br>
                                at
                        groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:298)<br>
                                at
                        groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:263)<br>
                                at
groovy.util.GroovyScriptEngine.loadScriptByName(GroovyScriptEngine.java:534)<br>
                                at
                        groovy.util.GroovyScriptEngine.createScript(GroovyScriptEngine.java:584)<br>
                                at
                        groovy.util.GroovyScriptEngine.run(GroovyScriptEngine.java:571)<br>
                                at
                        ShellWithGrabSupport.main(ShellWithGrabSupport.java:7)<br>
                                at <o:p></o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt">...<o:p></o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal" style="margin-bottom:12.0pt"><span
                        style="font-size:12.0pt">Does anyone know a way?<br>
                        <br>
                        <o:p></o:p></span></p>
                  </div>
                  <div>
                    <p class="MsoNormal"><span style="font-size:12.0pt"><o:p> </o:p></span></p>
                  </div>
                </div>
              </blockquote>
            </div>
          </div>
        </div>
      </div>
    </blockquote>
  </body>
</html>

--------------0xhwOa6oe9Dn0j2TZ108mOOs--