Coder Social home page Coder Social logo

Comments (2)

graemerocher avatar graemerocher commented on July 20, 2024

hmm nothing seems to have changed with service loading in 4.4.x

from micronaut-core.

auke- avatar auke- commented on July 20, 2024

It looks like it is caused by the GraalVM version bump (org.graalvm.nativeimage:svm from 23.1.2 to 24.0.1):

java.lang.UnsupportedClassVersionError: com/oracle/svm/core/jdk/resources/NativeImageResourceFileSystemProvider has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:467)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.nextProviderClass(ServiceLoader.java:1217)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1228)
	at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273)
	at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309)
	at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393)
	at java.base/java.nio.file.spi.FileSystemProvider.loadInstalledProviders(FileSystemProvider.java:156)
	at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:207)
	at java.base/java.nio.file.spi.FileSystemProvider$1.run(FileSystemProvider.java:204)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
	at java.base/java.nio.file.spi.FileSystemProvider.installedProviders(FileSystemProvider.java:204)
	at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:526)
	at java.base/java.nio.file.FileSystems.newFileSystem(FileSystems.java:400)
	at io.micronaut.core.io.IOUtils.loadNestedJarUri(IOUtils.java:188)
	at io.micronaut.core.io.IOUtils.resolvePath(IOUtils.java:165)
	at io.micronaut.core.io.IOUtils.eachFile(IOUtils.java:98)
	at io.micronaut.core.io.service.ServiceScanner.computeMicronautServiceTypeNames(ServiceScanner.java:106)
	at io.micronaut.core.io.service.ServiceScanner$MicronautMetaServicesLoader.compute(ServiceScanner.java:296)
	at java.base/java.util.concurrent.RecursiveAction.exec(RecursiveAction.java:194)
	at java.base/java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:373)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java)

This exception is swallowed, probably in IOUtils.eachFile().

When I downgrade org.graalvm.nativeimage:svm back to 23.1.2 it works again. It looks like the 24.x branch is compiled for Java 21. The latest 23.x version, 23.1.3 does also works. I can't find any relevant information about this in the GraalVM changelogs.

Since Micronaut 4.x targets both Java 17 and Java 21 I suppose the 23.x version of the GraalVM components should be used.

Furthermore it would be nice if the exception in IOUtils.eachFile() isn't swallowed as it makes finding the cause for this issue very hard.

from micronaut-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.