You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am attempting to use the JimFS in-memory Java NIO FileSystem provider in my Quarkus application and I am encountering a classloader issue. Given the nature of JimFS it needs to load in the System Classload and I utilized the quarkus.class-loading.parent-first-artifacts configuration to identify it as needing to be loaded in the base classloader. While this setting works fine for JUnit tests it does not work in fast-jar mode when running Quarkus in dev mode and production mode. It is my understanding that this was supposed to be fixed in #17391
Expected behavior
The JimFS jar will be loaded in the application classloader instead of the runtime classloader in all run modes (dev/test/prod).
Actual behavior
An exception is generated due to JimFS not being loaded in the correct classloader and the registration of a custom URL failing.
2021-05-27 22:59:18,833 ERROR [FileManager] (Quarkus Main Thread) Loaded from ClassLoader QuarkusClassLoader:Quarkus Base Runtime ClassLoader: DEV
2021-05-27 22:59:18,838 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.net.MalformedURLException: unknown protocol: jimfs
at java.base/java.net.URL.<init>(URL.java:679)
at java.base/java.net.URL.fromURI(URL.java:746)
at java.base/java.net.URI.toURL(URI.java:1139)
at quarkus.imfs.reproducer.FileManager.onStart(FileManager.java:27)
...
Describe the bug
I am attempting to use the JimFS in-memory Java NIO FileSystem provider in my Quarkus application and I am encountering a classloader issue. Given the nature of JimFS it needs to load in the System Classload and I utilized the quarkus.class-loading.parent-first-artifacts configuration to identify it as needing to be loaded in the base classloader. While this setting works fine for JUnit tests it does not work in fast-jar mode when running Quarkus in dev mode and production mode. It is my understanding that this was supposed to be fixed in #17391
Expected behavior
The JimFS jar will be loaded in the application classloader instead of the runtime classloader in all run modes (dev/test/prod).
Actual behavior
An exception is generated due to JimFS not being loaded in the correct classloader and the registration of a custom URL failing.
To Reproduce
Here is a link to the reproducer: quarkus-jimfs
Steps to reproduce the behavior:
mvn clean install
. The project will successfully build and the test will successfully run with JimFS loaded in the correct base classloader.mvn clean install quarkus:dev
The application will fail to start due to JimFS being loaded in the incorrect runtime classloader.java -jar target/quarkus-app/quarkus-run.jar
The same classloader issue will occur.Configuration
quarkus.class-loading.parent-first-artifacts=com.google.jimfs
Output of
java -version
I tested with JDK 11 as well and the same error occured.
Quarkus Version
2.0.0.CR2
The text was updated successfully, but these errors were encountered: