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
Copy file name to clipboardExpand all lines: _versions/main/guides/getting-started-testing.adoc
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -369,6 +369,8 @@ public class GreetingServiceTest {
369
369
----
370
370
<1> The `GreetingService` bean will be injected into the test
371
371
372
+
TIP: If you want to inject/test a `@SessionScoped` bean then it's very likely that the session context is not active and you would receive the `ContextNotActiveException` when a method of the injected bean is invoked. However, it's possible to use the `@io.quarkus.test.ActivateSessionContext` interceptor binding to activate the session context for a specific business method. Please read the javadoc for futher limitations.
373
+
372
374
== Applying Interceptors to Tests
373
375
374
376
As mentioned above Quarkus tests are actually full CDI beans, and as such you can apply CDI interceptors as you would
Copy file name to clipboardExpand all lines: _versions/main/guides/writing-native-applications-tips.adoc
+22-13Lines changed: 22 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -197,7 +197,7 @@ public class MyReflectionConfiguration {
197
197
}
198
198
----
199
199
200
-
Note: By default the `@RegisterForReflection` annotation will also registered any potential nested classes for reflection. If you want to avoid this behavior, you can set the `ignoreNested` attribute to `true`.
200
+
Note: By default the `@RegisterForReflection` annotation will also register any potential nested classes for reflection. If you want to avoid this behavior, you can set the `ignoreNested` attribute to `true`.
201
201
202
202
==== Using a configuration file
203
203
@@ -320,6 +320,23 @@ and in the case of using the Maven configuration instead of `application.propert
320
320
----
321
321
====
322
322
323
+
[[managing-proxy-classes-app]]
324
+
=== Managing Proxy Classes
325
+
326
+
While writing native application you'll need to define proxy classes at image build time by specifying the list of interfaces that they implement.
327
+
328
+
In such a situation, the error you might encounter is:
329
+
330
+
[source]
331
+
----
332
+
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.
333
+
----
334
+
335
+
To solve the issue you can create a `proxy-config.json` file under the `src/main/resources/META-INF/native-image/<group-id>/<artifact-id>` folder.
336
+
For more information about the format of the `proxy-config.json`, see the 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
+
Alternatively, you can create a quarkus extension and register the proxy classes as described in <<managing-proxy-classes-extension>>.
339
+
323
340
[[modularity-benefits]]
324
341
=== Modularity Benefits
325
342
@@ -618,18 +635,10 @@ Using such a construct means that a `--initialize-at-run-time` option will autom
618
635
For more information about the `--initialize-at-run-time` option, see the link:https://www.graalvm.org/{graalvm-docs-version}/reference-manual/native-image/optimizations-and-performance/ClassInitialization/[GraalVM Class Initialization in Native Image] guide.
619
636
====
620
637
638
+
[[managing-proxy-classes-extension]]
621
639
=== Managing Proxy Classes
622
640
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:
641
+
Similarly, Quarkus allows extensions authors to register a `NativeImageProxyDefinitionBuildItem`. An example of doing so is:
633
642
634
643
[source,java]
635
644
----
@@ -645,8 +654,8 @@ public class S3Processor {
645
654
----
646
655
647
656
This will allow Quarkus to generate the necessary configuration 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 https://www.graalvm.org/{graalvm-docs-version}/reference-manual/native-image/metadata/#dynamic-proxy-metadata-in-json[Dynamic Proxy Metadata in JSON] documentation.
657
+
658
+
Alternatively, you may create a `proxy-config.json` as described in <<managing-proxy-classes-app>>.
0 commit comments