Skip to content

[Tracing Agent][GR-64510] Collect Metadata with the Tracing Agent #11054

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

Open
1 task done
alixiaodi opened this issue Apr 21, 2025 · 2 comments
Open
1 task done

[Tracing Agent][GR-64510] Collect Metadata with the Tracing Agent #11054

alixiaodi opened this issue Apr 21, 2025 · 2 comments
Assignees

Comments

@alixiaodi
Copy link

Describe the Issue

I am currently using any plugin to package Maven projects into JAR files. My project is a JavaFX project with CSS and FXML. When executing - agentlib: native image agent, it will start my project, but clicking on the above operation will result in an error and the final generated native image is incomplete.

Image

demo.zip

The collected questions have been screenshot and the relevant demo project has been uploaded

Using the latest version of GraalVM can resolve many issues.

GraalVM Version

(base) PS C:\Users\16973\IdeaProjects\demo\target> java -agentlib:native-image-agent=config-merge-dir=native-image -jar .\demo-1.0-SNAPSHOT.jar
4月 21, 2025 10:15:04 上午 com.sun.javafx.application.PlatformImpl startup
警告: Unsupported JavaFX configuration: classes were loaded from 'unnamed module @42dd317f'
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by com.sun.glass.utils.NativeLibLoader in an unnamed module (file:/C:/Users/16973/IdeaProjects/demo/target/depen
dencies/javafx-graphics-17.0.6-win.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled

WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::allocateMemory has been called by com.sun.marlin.OffHeapArray (file:/C:/Users/16973/IdeaProjects/demo/target/dependencies/javafx-graph
ics-17.0.6-win.jar)
WARNING: Please consider reporting this to the maintainers of class com.sun.marlin.OffHeapArray
WARNING: sun.misc.Unsafe::allocateMemory will be removed in a future release
Warning: Error processing trace entry map(size=5, {(tracer,reflect),(function,findResourceAsStream),(caller_class,java.lang.Module),(result,true),(args,[com/sun
/javafx/reflect/Trampoline.class])}): java.lang.IllegalArgumentException: List must have exactly 2 element(s)
at org.graalvm.nativeimage.configure/com.oracle.svm.configure.trace.AbstractProcessor.expectSize(AbstractProcessor.java:52)
at org.graalvm.nativeimage.configure/com.oracle.svm.configure.trace.ReflectionProcessor.processEntry(ReflectionProcessor.java:79)
at org.graalvm.nativeimage.configure/com.oracle.svm.configure.trace.TraceProcessor.processEntry(TraceProcessor.java:91)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.tracing.ConfigurationResultWriter.traceEntry(ConfigurationResultWriter.java:53)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.tracing.core.Tracer.traceCall(Tracer.java:126)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.traceBreakpoint(BreakpointInterceptor.java:192)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.traceReflectBreakpoint(BreakpointInterceptor.java:181)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.handleResourceRegistration(BreakpointInterceptor.java:615)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.findResource(BreakpointInterceptor.java:628)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.onBreakpoint(BreakpointInterceptor.java:1206)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.headers.JNIFunctionPointerTypes$GetMethodIDFunctionPointer.invoke(JNIFunctionPointerTypes.jav
a)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.resolveBreakpointMethod(BreakpointInterceptor.java:1539)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.installBreakpointIfClassLoader(BreakpointInterceptor.java:1274)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.onClassPrepare(BreakpointInterceptor.java:1266)

Operating System and Version

w10

Build Command

java -agentlib:native-image-agent=config-merge-dir=native-image -jar .\demo-1.0-SNAPSHOT.jar

Expected Behavior

Successfully generated metadata

Actual Behavior

Warning: Error processing trace entry map(size=5, {(tracer,reflect),(function,findResourceAsStream),(caller_class,java.lang.Module),(result,true),(args,[com/sun
/javafx/reflect/Trampoline.class])}): java.lang.IllegalArgumentException: List must have exactly 2 element(s)
at org.graalvm.nativeimage.configure/com.oracle.svm.configure.trace.AbstractProcessor.expectSize(AbstractProcessor.java:52)
at org.graalvm.nativeimage.configure/com.oracle.svm.configure.trace.ReflectionProcessor.processEntry(ReflectionProcessor.java:79)
at org.graalvm.nativeimage.configure/com.oracle.svm.configure.trace.TraceProcessor.processEntry(TraceProcessor.java:91)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.tracing.ConfigurationResultWriter.traceEntry(ConfigurationResultWriter.java:53)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.tracing.core.Tracer.traceCall(Tracer.java:126)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.traceBreakpoint(BreakpointInterceptor.java:192)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.traceReflectBreakpoint(BreakpointInterceptor.java:181)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.handleResourceRegistration(BreakpointInterceptor.java:615)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.findResource(BreakpointInterceptor.java:628)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.onBreakpoint(BreakpointInterceptor.java:1206)
at org.graalvm.nativeimage.builder/com.oracle.svm.core.jni.headers.JNIFunctionPointerTypes$GetMethodIDFunctionPointer.invoke(JNIFunctionPointerTypes.jav
a)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.resolveBreakpointMethod(BreakpointInterceptor.java:1539)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.installBreakpointIfClassLoader(BreakpointInterceptor.java:1274)
at org.graalvm.nativeimage.agent.tracing/com.oracle.svm.agent.BreakpointInterceptor.onClassPrepare(BreakpointInterceptor.java:1266)

Steps to Reproduce

  1. mvn package
  2. java -agentlib:native-image-agent=config-merge-dir=native-image -jar .\demo-1.0-SNAPSHOT.jar

Additional Context

No response

Build Log Output and Error Messages

No response

@oubidar-Abderrahim
Copy link
Member

Thank you for reaching out, what version of GraalVM you're using?

@alixiaodi
Copy link
Author

感谢您的联系,您使用的是哪个版本的 GraalVM?

I have tried many versions, but there are still issues. The specific version is shown in the following picture

Image

@oubidar-Abderrahim oubidar-Abderrahim changed the title Collect Metadata with the Tracing Agent [Tracing Agent][GR-64510] Collect Metadata with the Tracing Agent Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants