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
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: spring-native-docs/src/main/asciidoc/tracing-agent.adoc
+31-8Lines changed: 31 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,8 +10,6 @@ When using the agent to compute configuration for native-image, there are a coup
10
10
11
11
The first option is interesting for identifying the missing native configuration when a library or a pattern is not recognized by Spring Native.
12
12
13
-
NOTE: See this related https://github.com/oracle/graal/issues/3283[graal#3283] issue that should make this process much easier. For now, you can make a manual diff between the native configuration generated by Spring Native and the one generated by the tracing agent.
14
-
15
13
The second option sounds more appealing for a repeatable setup but by default the generated configuration will include anything required by the test infrastructure, which is unnecessary when the application runs for real.
16
14
To address this problem the agent supports an access-filter file that will cause certain data to be excluded from the generated output.
17
15
@@ -92,15 +90,42 @@ This following snippet would go into the maven pom:
NOTE: You need to activate the AOT mode when running the tracing agent on the application as documented in <<spring-aot-modes>>,
128
+
NOTE: You need to activate the AOT mode when running the tracing agent on the application as documented in <<aot-modes>>,
104
129
for tests this is not needed since AOT mode is enabled automatically when AOT files are detected.
105
130
106
131
Also update the `spring-aot` build plugin to enable the `native-agent` mode in order to not generate `*-config.json` files since the agent will take care of that:
@@ -116,6 +141,4 @@ Also update the `spring-aot` build plugin to enable the `native-agent` mode in o
116
141
</plugin>
117
142
----
118
143
119
-
Run the JVM tests with `mvn clean test` to generate the native configuration, then build the native image with `mvn -DskipTests -Pnative package`. If that's not enough, you can add additional native configuration using `@NativeHint` annotations.
120
-
121
-
WARNING: If you see a `java.lang.ClassCastException: sun.reflect.generics.tree.FieldTypeSignature[] cannot be cast to java.lang.reflect.Type[]` error, this is a GraalVM bug related to https://github.com/oracle/graal/pull/4075. A workaround is to replace `queryAll*` entries by "All*" entries.
144
+
Build the native image with `mvn -Pnative -DskipNativeTests package`. If that's not enough, you can add additional native configuration using `@NativeHint` annotations.
0 commit comments