kazurayam / ks_comparingElementScreenshots_using_Inspectus

0 stars 0 forks source link

java.lang.Error: Circular loading of installed providers detected #1

Closed kazurayam closed 11 months ago

kazurayam commented 11 months ago

MacBook Air, M1 macOS 12.7.1 Katalon Studio Arm64 v9.0

I created this project newly. I followed the instruction of inspectus4katalon-sample-project v0.5.0 to inject the sample code and the required jars.

I got the following jar files in the Drivers directory

$ ls
AUTOIMPORTED_ExecutionProfilesLoader-2.1.0.jar
AUTOIMPORTED_ashot-1.5.4.jar
AUTOIMPORTED_ashotwrapper-0.2.1.jar
AUTOIMPORTED_commons-csv-1.9.0.jar
AUTOIMPORTED_freemarker-2.3.31.jar
AUTOIMPORTED_inspectus-0.10.0.jar
AUTOIMPORTED_java-diff-utils-4.11.jar
AUTOIMPORTED_jsoup-1.14.3.jar
AUTOIMPORTED_materialstore-0.16.6.jar

I executed Test Cases/CURA/main. I got the following error:

java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:117)
    at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:39)
Caused by: java.lang.Error: Circular loading of installed providers detected
    at java.base/java.nio.file.spi.FileSystemProvider.installedProviders(FileSystemProvider.java:198)
    at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:336)
    at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:288)
    at org.codehaus.groovy.vmplugin.v9.ClassFinder.maybeNewFileSystem(ClassFinder.java:177)
    at org.codehaus.groovy.vmplugin.v9.ClassFinder.find(ClassFinder.java:122)
    at org.codehaus.groovy.vmplugin.v9.ClassFinder.find(ClassFinder.java:109)
    at org.codehaus.groovy.vmplugin.v9.Java9.doFindClasses(Java9.java:116)
    at org.codehaus.groovy.vmplugin.v9.Java9.getDefaultImportClasses(Java9.java:103)
    at org.codehaus.groovy.control.ResolveVisitor.<clinit>(ResolveVisitor.java:647)
    at org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:816)
    at groovy.lang.GroovyObjectSupport.getDefaultMetaClass(GroovyObjectSupport.java:46)
    at groovy.lang.GroovyObjectSupport.<init>(GroovyObjectSupport.java:32)
    at groovy.lang.Closure.<init>(Closure.java:211)
    at groovy.lang.Closure.<init>(Closure.java:228)
    at groovy.lang.Closure$1.<init>(Closure.java:193)
    at groovy.lang.Closure.<clinit>(Closure.java:193)
    at java.base/java.lang.Class.forName0(Native Method)
    at java.base/java.lang.Class.forName(Class.java:375)
    at groovyjarjarpicocli.CommandLine$DefaultFactory.loadClosureClass(CommandLine.java:5477)
    at groovyjarjarpicocli.CommandLine$DefaultFactory.<clinit>(CommandLine.java:5475)
    at groovyjarjarpicocli.CommandLine.<init>(CommandLine.java:196)
    at groovy.ui.GroovyMain.processArgs(GroovyMain.java:128)
    at groovy.ui.GroovyMain.main(GroovyMain.java:115)
    ... 6 more
kazurayam commented 11 months ago

I suppose the error "java.lang.Error: Circular loading of installed providers detected" is caused by

https://github.com/kazurayam/materialstore/issues/437

The materialstore-0.16.6.jar has depenencies { implementation to the S3FileSystem. The jar of S3FileSystem includes the SPI Provider implementation of java.nio.file.FileSystem. This caused this error.

A change has alredy been done in the materialstore library:

https://github.com/kazurayam/materialstore/commit/f2a2030336f6cfde2c37a42189f624d9cfe315e6

The Inspectus Gradle Plugin should deliver the newer version of materialstore.

kazurayam commented 11 months ago

In the materialstore v0.16.6 jar contained a file META-INF/services/java.nio.file.spi.FileSystemProvider, as follows

Screenshot 2023-12-02 at 14 04 12

The mateialstore jar should not contain the file.

kazurayam commented 11 months ago

I created a new jar of the materialstore WITHOUT the META-INF/services/java.nio.file.spi.FileSystemProvider and brought it into the Drivers directory. I ran this project. It worked OK without the error "java.lang.Error: Circular loading of installed providers detected".

So, I need to update the materialstore library first.

kazurayam commented 11 months ago

fixed by the materialstore v0.17.0