Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caused by: java.lang.IllegalArgumentException: Method "list" could not be invoked #8541

Open
anshu-zs opened this issue Mar 8, 2024 · 14 comments
Assignees
Labels
agent Issues with the agent bug native-image

Comments

@anshu-zs
Copy link

anshu-zs commented Mar 8, 2024

Hi,
I created a native image executable by using tracing agent which collects reachability meta data but when I'm trying to run the native image I'm getting this exception.

Exception in thread "main" io.github.classgraph.ClassGraphException: Uncaught exception during scan
        at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1637)
        at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1654)
        at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1667)
        at com.zopsmart.rocket.engine.scanner.ClassScanner.scanClasses(ClassScanner.java:42)
        at com.zopsmart.rocket.engine.DependencyEngine.build(DependencyEngine.java:714)
        at com.zopsmart.rocket.engine.EngineManager.buildDependencyStore(EngineManager.java:68)
        at com.zopsmart.rocket.context.ContextManager.initStores(ContextManager.java:67)
        at com.zopsmart.rocket.context.ContextManager.initPrimaryContexts(ContextManager.java:48)
        at com.zopsmart.rocket.context.ContextManager.<init>(ContextManager.java:37)
        at com.zopsmart.rocket.Rocket.initialize(Rocket.java:44)
        at com.zopsmart.rocket.Rocket.run(Rocket.java:99)
        at examples.http.Main.main(Main.java:10)
Caused by: java.lang.IllegalArgumentException: Method "list" could not be invoked
        at nonapi.io.github.classgraph.reflection.ReflectionUtils.invokeMethod(ReflectionUtils.java:230)
        at io.github.classgraph.ModuleReaderProxy.list(ModuleReaderProxy.java:111)
        at io.github.classgraph.ClasspathElementModule.scanPaths(ClasspathElementModule.java:318)
        at io.github.classgraph.Scanner$4.processWorkUnit(Scanner.java:1100)
        at io.github.classgraph.Scanner$4.processWorkUnit(Scanner.java:1094)
        at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkLoop(WorkQueue.java:246)
        at nonapi.io.github.classgraph.concurrency.WorkQueue.access$000(WorkQueue.java:50)
        at nonapi.io.github.classgraph.concurrency.WorkQueue$1.call(WorkQueue.java:201)
        at nonapi.io.github.classgraph.concurrency.WorkQueue$1.call(WorkQueue.java:198)
        at java.base@11.0.18/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base@11.0.18/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base@11.0.18/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base@11.0.18/java.lang.Thread.run(Thread.java:829)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:775)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base@11.0.18/java.lang.reflect.Method.invoke(Method.java:566)
        at nonapi.io.github.classgraph.reflection.StandardReflectionDriver.invokeMethod(StandardReflectionDriver.java:193)
        at nonapi.io.github.classgraph.reflection.ReflectionUtils.invokeMethod(ReflectionUtils.java:227)
        ... 14 more
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: JRT file system is disabled
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:89)
        at java.base@11.0.18/jdk.internal.module.SystemModuleFinders$SystemImage.reader(SystemModuleFinders.java:139)
        at java.base@11.0.18/jdk.internal.module.SystemModuleFinders$ModuleContentSpliterator.<init>(SystemModuleFinders.java:508)
        at java.base@11.0.18/jdk.internal.module.SystemModuleFinders$SystemModuleReader.list(SystemModuleFinders.java:483)
        ... 17 more

created the native image using this command :

 native-image --no-fallback   -H:ConfigurationFileDirectories=META-INF/native-image --initialize-at-build-time=org.slf4j.LoggerFactory,ch.qos.logback,io.netty  -H:+ReportUnsupportedElementsAtRuntime    -H:Class=examples.http.Main  -cp rocket-examples-0.31.0.jar

Here is the output while creating native image

========================================================================
GraalVM Native Image: Generating 'examples.http.main' (executable)...
========================================================================================================================
Warning: Unknown attribute(s) [allSigners, allRecordComponents, allNestMembers] in reflection class descriptor object
Warning: Could not resolve nonapi.io.github.classgraph.ClassGraph for reflection configuration. Reason: java.lang.ClassNotFoundException: nonapi.io.github.classgraph.ClassGraph.
Warning: Could not resolve com.zopsmart.rocket,com.zopsmart.rocket.logger.JsonFormatter for reflection configuration. Reason: java.lang.ClassNotFoundException: com.zopsmart.rocket,com.zopsmart.rocket.logger.JsonFormatter.
Warning: Could not resolve ccom.zopsmart.rocket.rlog.SystemData for reflection configuration. Reason: java.lang.ClassNotFoundException: ccom.zopsmart.rocket.rlog.SystemData.
Warning: Could not resolve com.zopsmart.rocket.ros.entity.ConfigEntity for reflection configuration. Reason: java.lang.ClassNotFoundException: com.zopsmart.rocket.ros.entity.ConfigEntity.
Warning: Could not resolve io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators for reflection configuration. Reason: java.lang.ClassNotFoundException: io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators.
Warning: Could not resolve nonapi.io.github.classgraph.classloaderhandler for reflection configuration. Reason: java.lang.ClassNotFoundException: nonapi.io.github.classgraph.classloaderhandler.
Warning: Could not resolve com.zopsmart.rocket.oauth. for reflection configuration. Reason: java.lang.ClassNotFoundException: com.zopsmart.rocket.oauth..
Warning: Could not resolve com.zopsmart.rocket,com.zopsmart.rocket.logger.JsonFormatter for reflection configuration. Reason: java.lang.ClassNotFoundException: com.zopsmart.rocket,com.zopsmart.rocket.logger.JsonFormatter.
Warning: Could not resolve ccom.zopsmart.rocket.rlog.SystemData for reflection configuration. Reason: java.lang.ClassNotFoundException: ccom.zopsmart.rocket.rlog.SystemData.
Warning: Could not resolve com.zopsmart.rocket.ros.entity.ConfigEntity for reflection configuration. Reason: java.lang.ClassNotFoundException: com.zopsmart.rocket.ros.entity.ConfigEntity.
Warning: Could not resolve io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators for reflection configuration. Reason: java.lang.ClassNotFoundException: io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators.
Warning: Could not resolve nonapi.io.github.classgraph.classloaderhandler for reflection configuration. Reason: java.lang.ClassNotFoundException: nonapi.io.github.classgraph.classloaderhandler.
Warning: Could not resolve com.zopsmart.rocket.oauth. for reflection configuration. Reason: java.lang.ClassNotFoundException: com.zopsmart.rocket.oauth..
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.compression.Lz4FrameEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.netty.handler.codec.marshalling.MarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.compression.Lz4FrameDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.compression.Lz4FrameEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.marshalling.MarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.marshalling.MarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.compression.Lz4FrameDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.compression.Lz4FrameEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: net/jpountz/lz4/LZ4Exception.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.marshalling.CompatibleMarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.marshalling.CompatibleMarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.marshalling.MarshallingDecoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteInput.
Warning: Could not register io.grpc.netty.shaded.io.netty.handler.codec.marshalling.MarshallingEncoder: queryAllPublicMethods for reflection. Reason: java.lang.NoClassDefFoundError: org/jboss/marshalling/ByteOutput.
Warning: Could not resolve com.google.auth.appengine.AppEngineCredentials for reflection configuration. Reason: java.lang.ClassNotFoundException: com.google.auth.appengine.AppEngineCredentials.
Warning: Could not resolve org.apache.commons.pool2.impl.DefaultEvictionPolicy for reflection configuration. Reason: java.lang.ClassNotFoundException: org.apache.commons.pool2.impl.DefaultEvictionPolicy.
[1/7] Initializing...                                                                                   (11.8s @ 0.76GB)
 Version info: 'GraalVM 22.3.1 Java 11 CE'
 Java version info: '11.0.18+10-jvmci-22.3-b13'
 C compiler: cc (apple, arm64, 15.0.0)
 Garbage collector: Serial GC
 4 user-specific feature(s)
 - com.google.api.gax.grpc.nativeimage.GrpcNettyFeature
 - com.google.api.gax.nativeimage.GoogleJsonClientFeature
 - com.google.api.gax.nativeimage.OpenCensusFeature
 - com.oracle.svm.thirdparty.gson.GsonFeature
Mar 07, 2024 3:48:14 PM com.google.api.gax.nativeimage.NativeImageUtils registerClassForReflection
WARNING: Failed to find io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators on the classpath for reflection.
15:48:29,400 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version ?
15:48:29,401 |-INFO in ch.qos.logback.classic.util.ContextInitializer@1dbf8787 - No custom configurators were discovered as a service.
15:48:29,401 |-INFO in ch.qos.logback.classic.util.ContextInitializer@1dbf8787 - Trying to configure with ch.qos.logback.classic.joran.SerializedModelConfigurator
15:48:29,401 |-INFO in ch.qos.logback.classic.util.ContextInitializer@1dbf8787 - Constructed configurator of type class ch.qos.logback.classic.joran.SerializedModelConfigurator
15:48:29,402 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.scmo]
15:48:29,402 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.scmo]
15:48:29,404 |-INFO in ch.qos.logback.classic.util.ContextInitializer@1dbf8787 - ch.qos.logback.classic.joran.SerializedModelConfigurator.configure() call lasted 1 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
15:48:29,404 |-INFO in ch.qos.logback.classic.util.ContextInitializer@1dbf8787 - Trying to configure with ch.qos.logback.classic.util.DefaultJoranConfigurator
15:48:29,404 |-INFO in ch.qos.logback.classic.util.ContextInitializer@1dbf8787 - Constructed configurator of type class ch.qos.logback.classic.util.DefaultJoranConfigurator
15:48:29,404 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
15:48:29,404 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar!/logback.xml]
15:48:29,405 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@718a18d0 - URL [jar:file:/Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar!/logback.xml] is not of type file
15:48:29,441 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word colorize with class [org.tuxdude.logback.extensions.LogColorizer]
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [io] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [org] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.zaxxer] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.datastax] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [net] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [io.lettuce] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.util] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.core] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.azure] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.netty] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [software.amazon.awssdk] to OFF
15:48:29,453 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.amazonaws] to OFF
15:48:29,453 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [STDOUT]
15:48:29,454 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
15:48:29,455 |-INFO in ch.qos.logback.classic.model.processor.RootLoggerModelHandler - Setting level of ROOT logger to TRACE
15:48:29,455 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [STDOUT] to Logger[ROOT]
15:48:29,455 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@7de59370 - End of configuration.
15:48:29,455 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@5c084884 - Registering current configuration as safe fallback point
15:48:29,455 |-INFO in ch.qos.logback.classic.util.ContextInitializer@1dbf8787 - ch.qos.logback.classic.util.DefaultJoranConfigurator.configure() call lasted 51 milliseconds. ExecutionStatus=DO_NOT_INVOKE_NEXT_IF_ANY
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by io.netty.util.internal.ReflectionUtil (file:/Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar) to constructor java.nio.DirectByteBuffer(long,int)
WARNING: Please consider reporting this to the maintainers of io.netty.util.internal.ReflectionUtil
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
[2/7] Performing analysis...  [************]                                                           (136.3s @ 3.01GB)
  24,986 (91.35%) of 27,351 classes reachable
  51,274 (70.74%) of 72,478 fields reachable
 172,151 (57.61%) of 298,842 methods reachable
   1,305 classes, 3,131 fields, and 21,411 methods registered for reflection
      95 classes,   123 fields, and    70 methods registered for JNI access
       6 native libraries: -framework CoreServices, -framework Foundation, dl, pthread, stdc++, z
[3/7] Building universe...                                                                              (41.6s @ 3.61GB)
[4/7] Parsing methods...      [******]                                                                  (36.0s @ 3.13GB)
GC warning: 19.0s spent in 6 GCs during the last stage, taking up 52.43% of the time.
            Please ensure more than 2.05GB of memory is available for Native Image
            to reduce GC overhead and improve image build time.
[5/7] Inlining methods...     [***]                                                                     (12.1s @ 1.85GB)
[6/7] Compiling methods...    [********]                                                                (64.3s @ 2.91GB)
[7/7] Creating image...                                                                                 (16.2s @ 3.67GB)
  61.30MB (53.03%) for code area:   112,334 compilation units
  53.03MB (45.88%) for image heap:  519,359 objects and 103 resources
   1.26MB ( 1.09%) for other data
 115.59MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 packages in code area:                               Top 10 object types in image heap:
   2.72MB com.google.protobuf                                 13.09MB byte[] for code metadata
   1.64MB i.g.xds.shaded.io.envoyproxy.envoy.config.core.v3    7.20MB java.lang.Class
   1.59MB sun.security.ssl                                     5.36MB byte[] for java.lang.String
   1.46MB i.g.x.shaded.io.envoyproxy.envoy.config.route.v3     4.95MB java.lang.String
   1.16MB java.lang.invoke                                     3.78MB byte[] for general heap data
   1.05MB java.util                                            3.62MB byte[] for embedded resources
   1.04MB i.g.xds.shaded.io.envoyproxy.envoy.api.v2.route      2.65MB byte[] for reflection metadata
1017.20KB io.grpc.xds.shaded.io.envoyproxy.envoy.api.v2.core   2.29MB com.oracle.svm.core.hub.DynamicHubCompanion
 899.48KB com.google.re2j                                    997.52KB java.lang.String[]
 842.09KB io.grpc.xds                                        933.13KB c.oracle.svm.core.reflect.SubstrateMethodAccessor
  47.31MB for 878 more packages                                7.78MB for 4031 more object types
------------------------------------------------------------------------------------------------------------------------
                       75.0s (22.3% of total time) in 96 GCs | Peak RSS: 2.05GB | CPU load: 2.44
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/examples.http.main (executable)
 /Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/examples.http.main.build_artifacts.txt (txt)

GraalVM version:

java 21.0.2 2024-01-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30, mixed mode, sharing)
OS: macOS Sonoma -v 14.3.1
Architecture: arm64

Also, I tried removing below snippets from reflect-config.json file

{
  "name":"jdk.internal.loader.BuiltinClassLoader",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true
},
{
  "name":"jdk.internal.loader.ClassLoaders$AppClassLoader",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true
},
{
  "name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true
},

Thanks

@medoussboug
Copy link
Member

medoussboug commented Mar 8, 2024

Hello, thank you for sharing your issue. I noticed in your logs that the GraalVm version you are using is outdated

[1/7] Initializing...                                                                                   (11.8s @ 0.76GB)
 Version info: 'GraalVM 22.3.1 Java 11 CE'
 Java version info: '11.0.18+10-jvmci-22.3-b13'

The latest GraalVM 22 released is GraalVM ce 22.3.3, but keep in mind that GraalVM 22 is no longer supported, did you try using the latest release? (you can find it here)

@medoussboug medoussboug assigned anshu-zs and unassigned medoussboug Mar 8, 2024
@anshu-zs
Copy link
Author

anshu-zs commented Mar 8, 2024

Hello, thank you for sharing your issue. I noticed in your logs that the GraalVm version you are using is outdated

[1/7] Initializing...                                                                                   (11.8s @ 0.76GB)
 Version info: 'GraalVM 22.3.1 Java 11 CE'
 Java version info: '11.0.18+10-jvmci-22.3-b13'

GraalVM 22 is no longer supported, the latest GraalVM 22 released is GraalVM 22.3.5, did you try using the latest release? (you can find it here)

Hi @medoussboug thank you for replying. I checked the link send by you and I can only find 22.3.3 as the latest version in it
and 22.3.3 doesn't has download option for macOS (aarch64)

@medoussboug
Copy link
Member

medoussboug commented Mar 8, 2024

@anshu-zs My bad I didn't explain it clearly, the latest GraalVM 22 released is GraalVM ce 22.3.3, but keep in mind that GraalVM 22 is no longer supported, did you try using the latest release (GraalVM for JDK 21)? (you can find it here)

@anshu-zs
Copy link
Author

anshu-zs commented Mar 8, 2024

@anshu-zs My bad I didn't explain it clearly, the latest GraalVM 22 released is GraalVM ce 22.3.3, but keep in mind that GraalVM 22 is no longer supported, did you try using the latest release (GraalVM for JDK 21)? (you can find it here)

@medoussboug I tried GraalVM for JDK 21
Here is the build output:

java 21.0.2 2024-01-16 LTS
Java(TM) SE Runtime Environment Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30)
Java HotSpot(TM) 64-Bit Server VM Oracle GraalVM 21.0.2+13.1 (build 21.0.2+13-LTS-jvmci-23.1-b30, mixed mode, sharing)
raramuri@apples-MacBook-Pro-4 libs % native-image --no-fallback  -cp /static/swagger/ -H:ConfigurationFileDirectories=/Users/raramuri/Desktop/Anshu/rocket/rocket-examples/src/main/resources/META-INF/native-image --initialize-at-build-time=org.slf4j.LoggerFactory,ch.qos.logback,io.netty  -H:+ReportUnsupportedElementsAtRuntime    -H:Class=examples.http.Main  -cp rocket-examples-0.31.0.jar
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.grpc.netty.shaded.io.netty/netty-transport/reflection-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=application\.properties' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=application\.conf' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=application\.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=.*Driver\.properties' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:DynamicProxyConfigurationResources=META-INF/native-image/com.datastax.oss/java-driver-core/proxy.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:+ReportUnsupportedElementsAtRuntime' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/com.datastax.oss/java-driver-core/reflection.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=reference\.conf' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.netty/netty-transport/reflection-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
========================================================================================================================
GraalVM Native Image: Generating 'examples.http.main' (executable)...
========================================================================================================================
[1/8] Initializing...                                                                                   (11.6s @ 0.29GB)
 Java version: 21.0.2+13-LTS, vendor version: Oracle GraalVM 21.0.2+13.1
 Graal compiler: optimization level: 2, target machine: armv8-a, PGO: off
 C compiler: cc (apple, arm64, 15.0.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 4 user-specific feature(s):
 - com.google.api.gax.grpc.nativeimage.GrpcNettyFeature
 - com.google.api.gax.nativeimage.GoogleJsonClientFeature
 - com.google.api.gax.nativeimage.OpenCensusFeature
 - com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
 4 experimental option(s) unlocked:
 - '-H:DynamicProxyConfigurationResources' (origin(s): 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar')
 - '-H:+ReportUnsupportedElementsAtRuntime' (alternative API option(s): --report-unsupported-elements-at-runtime; origin(s): command line)
 - '-H:IncludeResources' (origin(s): 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar')
 - '-H:ReflectionConfigurationResources' (origin(s): 'META-INF/native-image/io.netty/netty-transport/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/io.grpc.netty.shaded.io.netty/netty-transport/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar')
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 6.05GB of memory (75.6% of 8.00GB system memory, determined at start)
 - 8 thread(s) (100.0% of 8 available processor(s), determined at start)
Mar 08, 2024 3:20:24 PM com.google.api.gax.nativeimage.NativeImageUtils registerClassForReflection
WARNING: Failed to find io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators on the classpath for reflection.
15:20:27,352 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version ?
15:20:27,352 |-INFO in ch.qos.logback.classic.util.ContextInitializer@3df496d9 - No custom configurators were discovered as a service.
15:20:27,352 |-INFO in ch.qos.logback.classic.util.ContextInitializer@3df496d9 - Trying to configure with ch.qos.logback.classic.joran.SerializedModelConfigurator
15:20:27,352 |-INFO in ch.qos.logback.classic.util.ContextInitializer@3df496d9 - Constructed configurator of type class ch.qos.logback.classic.joran.SerializedModelConfigurator
15:20:27,352 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.scmo]
15:20:27,352 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.scmo]
15:20:27,354 |-INFO in ch.qos.logback.classic.util.ContextInitializer@3df496d9 - ch.qos.logback.classic.joran.SerializedModelConfigurator.configure() call lasted 0 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
15:20:27,354 |-INFO in ch.qos.logback.classic.util.ContextInitializer@3df496d9 - Trying to configure with ch.qos.logback.classic.util.DefaultJoranConfigurator
15:20:27,354 |-INFO in ch.qos.logback.classic.util.ContextInitializer@3df496d9 - Constructed configurator of type class ch.qos.logback.classic.util.DefaultJoranConfigurator
15:20:27,354 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
15:20:27,354 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar!/logback.xml]
15:20:27,354 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@13e12ab6 - URL [jar:file:/Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar!/logback.xml] is not of type file
15:20:27,393 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word colorize with class [org.tuxdude.logback.extensions.LogColorizer]
15:20:27,416 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [io] to OFF
15:20:27,416 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [org] to OFF
15:20:27,416 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.zaxxer] to OFF
15:20:27,416 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.datastax] to OFF
15:20:27,416 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [net] to OFF
15:20:27,416 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [io.lettuce] to OFF
15:20:27,416 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.util] to OFF
15:20:27,416 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.core] to OFF
15:20:27,422 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor] to OFF
15:20:27,422 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.azure] to OFF
15:20:27,422 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.netty] to OFF
15:20:27,422 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [software.amazon.awssdk] to OFF
15:20:27,423 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.amazonaws] to OFF
15:20:27,423 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [STDOUT]
15:20:27,423 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
15:20:27,428 |-INFO in ch.qos.logback.classic.model.processor.RootLoggerModelHandler - Setting level of ROOT logger to TRACE
15:20:27,428 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [STDOUT] to Logger[ROOT]
15:20:27,428 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@6cb59aa - End of configuration.
15:20:27,428 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@224f90eb - Registering current configuration as safe fallback point
15:20:27,428 |-INFO in ch.qos.logback.classic.util.ContextInitializer@3df496d9 - ch.qos.logback.classic.util.DefaultJoranConfigurator.configure() call lasted 74 milliseconds. ExecutionStatus=DO_NOT_INVOKE_NEXT_IF_ANY
[2/8] Performing analysis...  [******]                                                                 (116.2s @ 3.78GB)
   23,566 reachable types   (88.4% of   26,645 total)
   43,875 reachable fields  (64.1% of   68,451 total)
  178,663 reachable methods (58.6% of  304,635 total)
    9,205 types, 1,942 fields, and 20,432 methods registered for reflection
       88 types,    96 fields, and    69 methods registered for JNI access
        5 native libraries: -framework CoreServices, -framework Foundation, dl, pthread, z
[3/8] Building universe...                                                                              (57.8s @ 3.36GB)
[4/8] Parsing methods...      [******]                                                                  (32.2s @ 3.53GB)
[5/8] Inlining methods...     [***]                                                                     (15.0s @ 3.26GB)
[6/8] Compiling methods...    [***************]                                                        (236.2s @ 2.89GB)
[7/8] Layouting methods...    [*******]                                                                 (45.2s @ 4.70GB)
[8/8] Creating image...       [******]                                                                  (34.4s @ 4.28GB)
  74.87MB (57.08%) for code area:   103,855 compilation units
  54.89MB (41.85%) for image heap:  545,585 objects and 151 resources
   1.41MB ( 1.08%) for other data
 131.17MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area:                                Top 10 object types in image heap:
  46.91MB rocket-examples-0.31.0.jar                          21.28MB byte[] for code metadata
  15.29MB java.base                                            8.96MB byte[] for java.lang.String
   4.87MB svm.jar (Native Image)                               5.47MB java.lang.Class
   3.78MB java.xml                                             3.98MB java.lang.String
 536.43kB java.security.jgss                                   3.69MB byte[] for embedded resources
 503.25kB java.management                                      2.62MB byte[] for reflection metadata
 503.14kB java.rmi                                             1.08MB com.oracle.svm.core.hub.DynamicHubCompanion
 272.40kB java.naming                                        832.68kB byte[] for general heap data
 250.75kB jdk.crypto.ec                                      677.09kB c.o.svm.core.hub.DynamicHub$ReflectionMetadata
 239.62kB com.oracle.svm.svm_enterprise                      617.30kB c.oracle.svm.core.reflect.SubstrateMethodAccessor
   1.19MB for 35 more packages                                 5.74MB for 4307 more object types
                              Use '-H:+BuildReport' to create a report with more details.
------------------------------------------------------------------------------------------------------------------------
Security report:
 - Binary includes Java deserialization.
 - Use '--enable-sbom' to embed a Software Bill of Materials (SBOM) in the binary.
------------------------------------------------------------------------------------------------------------------------
Recommendations:
 PGO:  Use Profile-Guided Optimizations ('--pgo') for improved throughput.
 INIT: Adopt '--strict-image-heap' to prepare for the next GraalVM release.
 HEAP: Set max heap for improved and more predictable memory usage.
 CPU:  Enable more CPU features with '-march=native' for improved performance.
 QBM:  Use the quick build mode ('-Ob') to speed up builds during development.
------------------------------------------------------------------------------------------------------------------------
                      153.5s (27.3% of total time) in 210 GCs | Peak RSS: 1.99GB | CPU load: 2.27
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/examples.http.main (executable)
========================================================================================================================

but still I'm getting the same error

INFO [15:32:07]  Default properties successfully read. 
                                 (Memory: 3145728 Threads: 2)
INFO [15:32:07]  Loaded config from file: .env 
                                 (Memory: 3670016 Threads: 2)
INFO [15:32:07]  System environment properties successfully read. 
                                 (Memory: 3670016 Threads: 2)
Exception in thread "main" io.github.classgraph.ClassGraphException: Uncaught exception during scan
        at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1637)
        at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1654)
        at io.github.classgraph.ClassGraph.scan(ClassGraph.java:1667)
        at com.zopsmart.rocket.engine.scanner.ClassScanner.scanClasses(ClassScanner.java:42)
        at com.zopsmart.rocket.engine.DependencyEngine.build(DependencyEngine.java:714)
        at com.zopsmart.rocket.engine.EngineManager.buildDependencyStore(EngineManager.java:68)
        at com.zopsmart.rocket.context.ContextManager.initStores(ContextManager.java:67)
        at com.zopsmart.rocket.context.ContextManager.initPrimaryContexts(ContextManager.java:48)
        at com.zopsmart.rocket.context.ContextManager.<init>(ContextManager.java:37)
        at com.zopsmart.rocket.Rocket.initialize(Rocket.java:44)
        at com.zopsmart.rocket.Rocket.run(Rocket.java:99)
        at examples.http.Main.main(Main.java:10)
        at java.base@21.0.2/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)
Caused by: java.lang.IllegalArgumentException: Method "list" could not be invoked
        at nonapi.io.github.classgraph.reflection.ReflectionUtils.invokeMethod(ReflectionUtils.java:230)
        at io.github.classgraph.ModuleReaderProxy.list(ModuleReaderProxy.java:111)
        at io.github.classgraph.ClasspathElementModule.scanPaths(ClasspathElementModule.java:318)
        at io.github.classgraph.Scanner$4.processWorkUnit(Scanner.java:1100)
        at io.github.classgraph.Scanner$4.processWorkUnit(Scanner.java:1094)
        at nonapi.io.github.classgraph.concurrency.WorkQueue.runWorkLoop(WorkQueue.java:246)
        at nonapi.io.github.classgraph.concurrency.WorkQueue.access$000(WorkQueue.java:50)
        at nonapi.io.github.classgraph.concurrency.WorkQueue$1.call(WorkQueue.java:201)
        at nonapi.io.github.classgraph.concurrency.WorkQueue$1.call(WorkQueue.java:198)
        at java.base@21.0.2/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base@21.0.2/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base@21.0.2/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base@21.0.2/java.lang.Thread.runWith(Thread.java:1596)
        at java.base@21.0.2/java.lang.Thread.run(Thread.java:1583)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
Caused by: java.lang.reflect.InvocationTargetException
        at java.base@21.0.2/java.lang.reflect.Method.invoke(Method.java:580)
        at nonapi.io.github.classgraph.reflection.StandardReflectionDriver.invokeMethod(StandardReflectionDriver.java:193)
        at nonapi.io.github.classgraph.reflection.ReflectionUtils.invokeMethod(ReflectionUtils.java:227)
        ... 15 more
Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: JRT file system is disabled
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:121)
        at java.base@21.0.2/jdk.internal.module.SystemModuleFinders$SystemImage.reader(SystemModuleFinders.java:158)
        at java.base@21.0.2/jdk.internal.module.SystemModuleFinders$ModuleContentSpliterator.<init>(SystemModuleFinders.java:527)
        at java.base@21.0.2/jdk.internal.module.SystemModuleFinders$SystemModuleReader.list(SystemModuleFinders.java:502)
        ... 18 more

@anshu-zs
Copy link
Author

anshu-zs commented Mar 8, 2024

And also if I don't remove this snippet from reflect-config.json

{
  "name":"jdk.internal.loader.BuiltinClassLoader",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true
},
{
  "name":"jdk.internal.loader.ClassLoaders$AppClassLoader",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true
},
{
  "name":"jdk.internal.loader.ClassLoaders$PlatformClassLoader",
  "allDeclaredFields":true,
  "queryAllDeclaredMethods":true
},

I am getting this error at the time of image creation

Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.grpc.netty.shaded.io.netty/netty-transport/reflection-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=application\.properties' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=application\.conf' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=application\.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=.*Driver\.properties' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:DynamicProxyConfigurationResources=META-INF/native-image/com.datastax.oss/java-driver-core/proxy.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:+ReportUnsupportedElementsAtRuntime' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/com.datastax.oss/java-driver-core/reflection.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:IncludeResources=reference\.conf' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.netty/netty-transport/reflection-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
========================================================================================================================
GraalVM Native Image: Generating 'examples.http.main' (executable)...
========================================================================================================================
[1/8] Initializing...                                                                                   (12.2s @ 0.32GB)
 Java version: 21.0.2+13-LTS, vendor version: Oracle GraalVM 21.0.2+13.1
 Graal compiler: optimization level: 2, target machine: armv8-a, PGO: off
 C compiler: cc (apple, arm64, 15.0.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 4 user-specific feature(s):
 - com.google.api.gax.grpc.nativeimage.GrpcNettyFeature
 - com.google.api.gax.nativeimage.GoogleJsonClientFeature
 - com.google.api.gax.nativeimage.OpenCensusFeature
 - com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
 4 experimental option(s) unlocked:
 - '-H:DynamicProxyConfigurationResources' (origin(s): 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar')
 - '-H:+ReportUnsupportedElementsAtRuntime' (alternative API option(s): --report-unsupported-elements-at-runtime; origin(s): command line)
 - '-H:IncludeResources' (origin(s): 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar')
 - '-H:ReflectionConfigurationResources' (origin(s): 'META-INF/native-image/io.netty/netty-transport/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/io.grpc.netty.shaded.io.netty/netty-transport/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar', 'META-INF/native-image/com.datastax.oss/java-driver-core/native-image.properties' in 'file:///Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar')
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 6.05GB of memory (75.6% of 8.00GB system memory, determined at start)
 - 8 thread(s) (100.0% of 8 available processor(s), determined at start)
Mar 08, 2024 3:33:42 PM com.google.api.gax.nativeimage.NativeImageUtils registerClassForReflection
WARNING: Failed to find io.grpc.netty.shaded.io.netty.channel.ProtocolNegotiators on the classpath for reflection.
15:33:44,602 |-INFO in ch.qos.logback.classic.LoggerContext[default] - This is logback-classic version ?
15:33:44,602 |-INFO in ch.qos.logback.classic.util.ContextInitializer@729a9c3d - No custom configurators were discovered as a service.
15:33:44,602 |-INFO in ch.qos.logback.classic.util.ContextInitializer@729a9c3d - Trying to configure with ch.qos.logback.classic.joran.SerializedModelConfigurator
15:33:44,602 |-INFO in ch.qos.logback.classic.util.ContextInitializer@729a9c3d - Constructed configurator of type class ch.qos.logback.classic.joran.SerializedModelConfigurator
15:33:44,602 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.scmo]
15:33:44,603 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.scmo]
15:33:44,604 |-INFO in ch.qos.logback.classic.util.ContextInitializer@729a9c3d - ch.qos.logback.classic.joran.SerializedModelConfigurator.configure() call lasted 1 milliseconds. ExecutionStatus=INVOKE_NEXT_IF_ANY
15:33:44,604 |-INFO in ch.qos.logback.classic.util.ContextInitializer@729a9c3d - Trying to configure with ch.qos.logback.classic.util.DefaultJoranConfigurator
15:33:44,604 |-INFO in ch.qos.logback.classic.util.ContextInitializer@729a9c3d - Constructed configurator of type class ch.qos.logback.classic.util.DefaultJoranConfigurator
15:33:44,604 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
15:33:44,605 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar!/logback.xml]
15:33:44,605 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@574327ed - URL [jar:file:/Users/raramuri/Desktop/Anshu/rocket/rocket-examples/build/libs/rocket-examples-0.31.0.jar!/logback.xml] is not of type file
15:33:44,631 |-INFO in ch.qos.logback.core.joran.action.ConversionRuleAction - registering conversion word colorize with class [org.tuxdude.logback.extensions.LogColorizer]
15:33:44,643 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [io] to OFF
15:33:44,643 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [org] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.zaxxer] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.datastax] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [net] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [io.lettuce] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.util] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.core] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.azure] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [reactor.netty] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [software.amazon.awssdk] to OFF
15:33:44,644 |-INFO in ch.qos.logback.classic.model.processor.LoggerModelHandler - Setting level of logger [com.amazonaws] to OFF
15:33:44,644 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - Processing appender named [STDOUT]
15:33:44,645 |-INFO in ch.qos.logback.core.model.processor.AppenderModelHandler - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
15:33:44,647 |-INFO in ch.qos.logback.classic.model.processor.RootLoggerModelHandler - Setting level of ROOT logger to TRACE
15:33:44,647 |-INFO in ch.qos.logback.core.model.processor.AppenderRefModelHandler - Attaching appender named [STDOUT] to Logger[ROOT]
15:33:44,647 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@4687366b - End of configuration.
15:33:44,647 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@3a17acd4 - Registering current configuration as safe fallback point
15:33:44,647 |-INFO in ch.qos.logback.classic.util.ContextInitializer@729a9c3d - ch.qos.logback.classic.util.DefaultJoranConfigurator.configure() call lasted 43 milliseconds. ExecutionStatus=DO_NOT_INVOKE_NEXT_IF_ANY
[2/8] Performing analysis...  [******]                                                                 (130.8s @ 3.36GB)
   23,568 reachable types   (88.4% of   26,646 total)
   43,875 reachable fields  (64.1% of   68,431 total)
  178,663 reachable methods (58.6% of  304,677 total)
    9,210 types, 1,949 fields, and 20,475 methods registered for reflection
       88 types,    96 fields, and    69 methods registered for JNI access
        5 native libraries: -framework CoreServices, -framework Foundation, dl, pthread, z

Error: Unsupported features in 5 methods
Detailed message:
Error: Detected a ZipFile object in the image heap. A ZipFile object contains pointers to unmanaged C memory and file descriptors, and these resources are no longer available at image runtime. If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=java.util.jar.JarFile'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.
The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by
  reading field jdk.internal.module.ModuleReferences$JarModuleReader.jf of constant 
    jdk.internal.module.ModuleReferences$JarModuleReader@47c69152: jdk.internal.module.ModuleReferences$JarModuleReader@47c69152
  reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant 
    java.util.concurrent.ConcurrentHashMap$Node@782ad1a1: [module com.oracle.svm.svm_enterprise, location=file:///Library/Java/JavaVirtual...
  indexing into array java.util.concurrent.ConcurrentHashMap$Node[]@47ffd1a1: [Ljava.util.concurrent.ConcurrentHashMap$Node;@47ffd1a1
  reading field java.util.concurrent.ConcurrentHashMap.table of constant 
    java.util.concurrent.ConcurrentHashMap@605d0624: {[module jdk.jdwp.agent, location=jrt:/jdk.jdwp.agent]=jdk.internal.module.Syste...
  reading field jdk.internal.loader.BuiltinClassLoader.moduleToReader of constant 
    jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260: jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260
  reading field java.lang.Module.loader of constant 
    java.lang.Module@56235b8e: unnamed module @56235b8e
  reading field java.lang.Class.module of constant 
    java.lang.Class@268c4de8: class [Lcom.fasterxml.jackson.databind.deser.KeyDeserializers;
  manually triggered rescan
Error: Detected a ZipFile object in the image heap. A ZipFile object contains pointers to unmanaged C memory and file descriptors, and these resources are no longer available at image runtime. If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=java.util.jar.JarFile'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.
The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by
  reading field jdk.internal.module.ModuleReferences$JarModuleReader.jf of constant 
    jdk.internal.module.ModuleReferences$JarModuleReader@71c52d5b: jdk.internal.module.ModuleReferences$JarModuleReader@71c52d5b
  reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant 
    java.util.concurrent.ConcurrentHashMap$Node@341baec3: [module org.graalvm.nativeimage.base, location=file:///Library/Java/JavaVirtualM...
  indexing into array java.util.concurrent.ConcurrentHashMap$Node[]@47ffd1a1: [Ljava.util.concurrent.ConcurrentHashMap$Node;@47ffd1a1
  reading field java.util.concurrent.ConcurrentHashMap.table of constant 
    java.util.concurrent.ConcurrentHashMap@605d0624: {[module jdk.jdwp.agent, location=jrt:/jdk.jdwp.agent]=jdk.internal.module.Syste...
  reading field jdk.internal.loader.BuiltinClassLoader.moduleToReader of constant 
    jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260: jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260
  reading field java.lang.Module.loader of constant 
    java.lang.Module@56235b8e: unnamed module @56235b8e
  reading field java.lang.Class.module of constant 
    java.lang.Class@268c4de8: class [Lcom.fasterxml.jackson.databind.deser.KeyDeserializers;
  manually triggered rescan
Error: Detected a ZipFile object in the image heap. A ZipFile object contains pointers to unmanaged C memory and file descriptors, and these resources are no longer available at image runtime. If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=java.util.jar.JarFile'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.
The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by
  reading field jdk.internal.module.ModuleReferences$JarModuleReader.jf of constant 
    jdk.internal.module.ModuleReferences$JarModuleReader@7eb12f18: jdk.internal.module.ModuleReferences$JarModuleReader@7eb12f18
  reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant 
    java.util.concurrent.ConcurrentHashMap$Node@57eb8e77: [module org.graalvm.nativeimage.builder, location=file:///Library/Java/JavaVirtu...
  indexing into array java.util.concurrent.ConcurrentHashMap$Node[]@47ffd1a1: [Ljava.util.concurrent.ConcurrentHashMap$Node;@47ffd1a1
  reading field java.util.concurrent.ConcurrentHashMap.table of constant 
    java.util.concurrent.ConcurrentHashMap@605d0624: {[module jdk.jdwp.agent, location=jrt:/jdk.jdwp.agent]=jdk.internal.module.Syste...
  reading field jdk.internal.loader.BuiltinClassLoader.moduleToReader of constant 
    jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260: jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260
  reading field java.lang.Module.loader of constant 
    java.lang.Module@56235b8e: unnamed module @56235b8e
  reading field java.lang.Class.module of constant 
    java.lang.Class@268c4de8: class [Lcom.fasterxml.jackson.databind.deser.KeyDeserializers;
  manually triggered rescan
Error: Detected a ZipFile object in the image heap. A ZipFile object contains pointers to unmanaged C memory and file descriptors, and these resources are no longer available at image runtime. If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=java.util.jar.JarFile'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.
The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by
  reading field jdk.internal.module.ModuleReferences$JarModuleReader.jf of constant 
    jdk.internal.module.ModuleReferences$JarModuleReader@e3fdb40: jdk.internal.module.ModuleReferences$JarModuleReader@e3fdb40
  reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant 
    java.util.concurrent.ConcurrentHashMap$Node@26182105: [module org.graalvm.nativeimage.pointsto, location=file:///Library/Java/JavaVirt...
  indexing into array java.util.concurrent.ConcurrentHashMap$Node[]@47ffd1a1: [Ljava.util.concurrent.ConcurrentHashMap$Node;@47ffd1a1
  reading field java.util.concurrent.ConcurrentHashMap.table of constant 
    java.util.concurrent.ConcurrentHashMap@605d0624: {[module jdk.jdwp.agent, location=jrt:/jdk.jdwp.agent]=jdk.internal.module.Syste...
  reading field jdk.internal.loader.BuiltinClassLoader.moduleToReader of constant 
    jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260: jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260
  reading field java.lang.Module.loader of constant 
    java.lang.Module@56235b8e: unnamed module @56235b8e
  reading field java.lang.Class.module of constant 
    java.lang.Class@268c4de8: class [Lcom.fasterxml.jackson.databind.deser.KeyDeserializers;
  manually triggered rescan
Error: Detected a ZipFile object in the image heap. A ZipFile object contains pointers to unmanaged C memory and file descriptors, and these resources are no longer available at image runtime. If these objects should not be stored in the image heap, you can use 

    '--trace-object-instantiation=java.util.jar.JarFile'

to find classes that instantiate these objects. Once you found such a class, you can mark it explicitly for run time initialization with 

    '--initialize-at-run-time=<culprit>'

to prevent the instantiation of the object.
The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image runtime by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point.
Trace: Object was reached by
  reading field jdk.internal.module.ModuleReferences$JarModuleReader.jf of constant 
    jdk.internal.module.ModuleReferences$JarModuleReader@1009afee: jdk.internal.module.ModuleReferences$JarModuleReader@1009afee
  reading field java.util.concurrent.ConcurrentHashMap$Node.val of constant 
    java.util.concurrent.ConcurrentHashMap$Node@585d5b1: [module org.graalvm.nativeimage.objectfile, location=file:///Library/Java/JavaVi...
  reading field java.util.concurrent.ConcurrentHashMap$Node.next of constant 
    java.util.concurrent.ConcurrentHashMap$Node@5a19376a: [module jdk.jdi, location=jrt:/jdk.jdi]=jdk.internal.module.SystemModuleFinders$...
  indexing into array java.util.concurrent.ConcurrentHashMap$Node[]@47ffd1a1: [Ljava.util.concurrent.ConcurrentHashMap$Node;@47ffd1a1
  reading field java.util.concurrent.ConcurrentHashMap.table of constant 
    java.util.concurrent.ConcurrentHashMap@605d0624: {[module jdk.jdwp.agent, location=jrt:/jdk.jdwp.agent]=jdk.internal.module.Syste...
  reading field jdk.internal.loader.BuiltinClassLoader.moduleToReader of constant 
    jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260: jdk.internal.loader.ClassLoaders$AppClassLoader@2f7c7260
  reading field java.lang.Module.loader of constant 
    java.lang.Module@56235b8e: unnamed module @56235b8e
  reading field java.lang.Class.module of constant 
    java.lang.Class@268c4de8: class [Lcom.fasterxml.jackson.databind.deser.KeyDeserializers;
  manually triggered rescan

------------------------------------------------------------------------------------------------------------------------
                       33.1s (22.9% of total time) in 95 GCs | Peak RSS: 1.71GB | CPU load: 2.84
========================================================================================================================
Finished generating 'examples.http.main' in 2m 24s.

@medoussboug
Copy link
Member

Please provide us steps to reproduce and a reproducer in order to invertigate your issue

@anshu-zs
Copy link
Author

anshu-zs commented Mar 8, 2024

Please provide us steps to reproduce and a reproducer in order to invertigate your issue

@medoussboug sure, I will try to reproduce the issue and get back to you as soon as possible

@medoussboug
Copy link
Member

Hello, after a thorough look into your issue and specifically:

Caused by: com.oracle.svm.core.jdk.UnsupportedFeatureError: JRT file system is disabled
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.util.VMError.unsupportedFeature(VMError.java:121)
        at java.base@21.0.2/jdk.internal.module.SystemModuleFinders$SystemImage.reader(SystemModuleFinders.java:158)
        at java.base@21.0.2/jdk.internal.module.SystemModuleFinders$ModuleContentSpliterator.<init>(SystemModuleFinders.java:527)
        at java.base@21.0.2/jdk.internal.module.SystemModuleFinders$SystemModuleReader.list(SystemModuleFinders.java:502)
        ... 18 more

From this error we can understand that what you are trying to do is not supported by native image as you can see here

We advise you to follow one the following alternatives

  • you try to avoid using the failing code entirely
  • you can try to initialize the relevant classes at build-time.

@anshu-zs
Copy link
Author

anshu-zs commented Mar 9, 2024

Hi @medoussboug resolved this issue by adding -H:+AllowJRTFileSystem in command line while creating native image.

but classgraph is not able to scan the classes of my project

Here is my classScanner

public class ClassScanner {
    private static ScanResult scanResult;

    static {
        ClassGraph classGraph =
                new ClassGraph()
                        .enableAnnotationInfo().enableMethodInfo().enableFieldInfo();
        scanResult = classGraph.scan();


    }
}

Can u please help me out here

@fniephaus
Copy link
Member

@anshu-zs is ClassScanner initialized at build time (via --initialize-at-build-time=org.example.ClassScanner)? As a result, an instance of ScanResult will become part of the image heap, so you will have to mark it for build-time initialization as well, including all other types that the ScanResult references.
Alternatively, you could implement a Feature using classgraph (there's a related discuss on the GraalVM Slack). It's not clear to me what you actually need classgraph for, so it's hard to judge which approach is better at this point.

@anshu-zs
Copy link
Author

anshu-zs commented Mar 11, 2024

Hi @fniephaus thank you for replying. I tried initializing ClassScanner at build time, but it's still not able to load classes

Here is my classScanner:

public class ClassScanner {
    private static ScanResult scanResult;

    static {
        scanResult = new ClassGraph().disableModuleScanning() // added for GraalVM
                 .disableDirScanning() // added for GraalVM
                 .disableNestedJarScanning() // added for GraalVM
                 .disableRuntimeInvisibleAnnotations() // added for GraalVM
                .addClassLoader(ClassLoader.getSystemClassLoader()) // see
                .enableAnnotationInfo().enableMethodInfo().initializeLoadedClasses().scan();
    }
    
        public Set<Class> findAllClassesImplementingInterfaces(Class interfaceName) {
        Set<Class> classSet = new HashSet<>();
        ClassInfoList classInfos = scanResult.getClassesImplementing(interfaceName);
        for (ClassInfo clazz : classInfos) {
            classSet.add(clazz.loadClass());
        }
        System.out.println("ScanResult:   "+classSet);
        return classSet;
    }

ClassScanner usage

ClassScanner classScanner =new ClassScanner();
classScanner.findAllClassesImplementingInterfaces(IContext.class)

Here are the logs when I run the native image:

INFO [17:48:16]  Default properties successfully read. 
      (Memory: 2621440 Threads: 2)
INFO [17:48:16]  Loaded config from file: .env 
      (Memory: 3145728 Threads: 2)
INFO [17:48:16]  System environment properties successfully read. 
      (Memory: 3145728 Threads: 2)
      
scanResult: []

INFO [17:48:16]  Initializing dependencies. 
      (Memory: 3145728 Threads: 2)
INFO [17:48:16]  Dependencies successfully created. 
      (Memory: 3145728 Threads: 2)
INFO [17:48:16]  Started Application in 5.042 seconds 
      (Memory: 3145728 Threads: 2)
INFO [17:48:16]  Stopping application 
      (Memory: 4718592 Threads: 4)
INFO [17:48:16]  Application stopped 
      (Memory: 4718592 Threads: 4)

Here as u can see my scanResult shows empty array


When I run my application locally instead of running native image I get scanResult as

scanResult: [class com.zopsmart.rocket.context.AppContext, class com.zopsmart.rocket.context.ServerContext]

PS: I am not able to access the link shared(https://graalvm.slack.com/archives/CN9KSFB40/p1710066508832449?thread_ts=1709284553.106449&cid=CN9KSFB40). graalvm.slack.com. Also I'm getting scanResult as non empty when I'm working with graalvm 22.3.1 jdk 11 but facing other issue check here

@anshu-zs
Copy link
Author

anshu-zs commented Mar 12, 2024

Hi @fniephaus any update on the above issue

@medoussboug medoussboug assigned fniephaus and unassigned anshu-zs Mar 13, 2024
@StevenPG
Copy link

Bump, still having this issue:

Caused by: java.lang.IllegalArgumentException: Method "list" could not be invoked: java.lang.reflect.InvocationTargetException
	at nonapi.io.github.classgraph.reflection.ReflectionUtils.invokeMethod(ReflectionUtils.java:231) ~[na:na]

@anshu-zs
Copy link
Author

anshu-zs commented Apr 30, 2024

Bump, still having this issue:

Caused by: java.lang.IllegalArgumentException: Method "list" could not be invoked: java.lang.reflect.InvocationTargetException
	at nonapi.io.github.classgraph.reflection.ReflectionUtils.invokeMethod(ReflectionUtils.java:231) ~[na:na]

Hi @StevenPG I have already resolved this exception, but I am stuck in the classgraph issue mentioned above #8541 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent Issues with the agent bug native-image
Projects
None yet
Development

No branches or pull requests

4 participants