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
Update documentation for handling proxies in native-mode
* Merge "Managing Proxy Classes" sections.
* Remove outdated mention to `-H:DynamicProxyConfigurationResources`
Quarkus no longer uses `-H:DynamicProxyConfigurationResources` for
dynamic proxies. Instead it generates the corresponding necessary
metadata in `META-INF/native-image/proxy-config.json`
Copy file name to clipboardExpand all lines: docs/src/main/asciidoc/writing-native-applications-tips.adoc
+16-18Lines changed: 16 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -320,21 +320,6 @@ and in the case of using the Maven configuration instead of `application.propert
320
320
----
321
321
====
322
322
323
-
=== Managing Proxy Classes
324
-
325
-
While writing native application you'll need to define proxy classes at image build time by specifying the list of interfaces that they implement.
326
-
327
-
In such a situation, the error you might encounter is:
328
-
329
-
[source]
330
-
----
331
-
com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.apache.http.conn.HttpClientConnectionManager, interface org.apache.http.pool.ConnPoolControl, interface com.amazonaws.http.conn.Wrapped] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
332
-
----
333
-
334
-
Solving this issue requires creating a `proxy-config.json` file under the `src/main/resources/META-INF/native-image/<group-id>/<artifact-id>` folder.
335
-
This way the configuration will be automatically parsed by the native build, without additional configuration.
336
-
For more information about the format of this file, see the link:https://www.graalvm.org/{graalvm-docs-version}/reference-manual/native-image/metadata/#dynamic-proxy-metadata-in-json[Dynamic Proxy Metadata in JSON] documentation.
337
-
338
323
[[modularity-benefits]]
339
324
=== Modularity Benefits
340
325
@@ -635,7 +620,16 @@ For more information about the `--initialize-at-run-time` option, see the link:h
635
620
636
621
=== Managing Proxy Classes
637
622
638
-
Very similarly, Quarkus allows extensions authors to register a `NativeImageProxyDefinitionBuildItem`. An example of doing so is:
623
+
While writing native application you'll need to define proxy classes at image build time by specifying the list of interfaces that they implement.
624
+
625
+
In such a situation, the error you might encounter is:
626
+
627
+
[source]
628
+
----
629
+
com.oracle.svm.core.jdk.UnsupportedFeatureError: Proxy class defined by interfaces [interface org.apache.http.conn.HttpClientConnectionManager, interface org.apache.http.pool.ConnPoolControl, interface com.amazonaws.http.conn.Wrapped] not found. Generating proxy classes at runtime is not supported. Proxy classes need to be defined at image build time by specifying the list of interfaces that they implement. To define proxy classes use -H:DynamicProxyConfigurationFiles=<comma-separated-config-files> and -H:DynamicProxyConfigurationResources=<comma-separated-config-resources> options.
630
+
----
631
+
632
+
Quarkus allows extensions authors to register a `NativeImageProxyDefinitionBuildItem`. An example of doing so is:
639
633
640
634
[source,java]
641
635
----
@@ -650,11 +644,15 @@ public class S3Processor {
650
644
}
651
645
----
652
646
653
-
Using such a construct means that a `-H:DynamicProxyConfigurationResources` option will automatically be added to the `native-image` command line.
647
+
This will allow Quarkus to generate the necessary configurtion for handling the proxy class.
648
+
Alternatively, you may create a `proxy-config.json` file under the `src/main/resources/META-INF/native-image/<group-id>/<artifact-id>` folder.
649
+
For more information about the format of this file, see the link:https://www.graalvm.org/{graalvm-docs-version}/reference-manual/native-image/metadata/#dynamic-proxy-metadata-in-json[Dynamic Proxy Metadata in JSON] documentation.
654
650
655
651
[NOTE]
656
652
====
657
-
For more information about Proxy Classes, see the link:https://www.graalvm.org/{graalvm-docs-version}/reference-manual/native-image/guides/configure-dynamic-proxies/[GraalVM Configure Dynamic Proxies Manually] guide.
653
+
In both cases the configuration will be automatically parsed by the native build, without additional configuration.
654
+
655
+
For more information about using Proxy Classes in native executables, see link:https://www.graalvm.org/jdk21/reference-manual/native-image/dynamic-features/DynamicProxy/[Dynamic Proxy in Native Image] and link:https://www.graalvm.org/{graalvm-docs-version}/reference-manual/native-image/guides/configure-dynamic-proxies/[GraalVM Configure Dynamic Proxies Manually].
0 commit comments