From d06eddf03b104892cb00e15a698e3c7e12c59eca Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 5 Apr 2021 11:05:56 +0300 Subject: [PATCH] Fix JAX-RS Application class hierarchy handling in RESTEasy Reactive --- .../server/test/path/RestApplicationPathTestCase.java | 7 +++++-- .../common/processor/scanning/ResteasyReactiveScanner.java | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/path/RestApplicationPathTestCase.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/path/RestApplicationPathTestCase.java index 2bdc84d39bd7b..97ad921ff0e10 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/path/RestApplicationPathTestCase.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/test/java/io/quarkus/resteasy/reactive/server/test/path/RestApplicationPathTestCase.java @@ -20,7 +20,7 @@ public class RestApplicationPathTestCase { .overrideConfigKey("quarkus.rest.path", "/foo") .overrideConfigKey("quarkus.http.root-path", "/app") .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(HelloResource.class, BarApp.class)); + .addClasses(HelloResource.class, BarApp.class, BaseApplication.class)); /** * Using @ApplicationPath will overlay/replace `quarkus.rest.path`. @@ -33,7 +33,10 @@ public class RestApplicationPathTestCase { * This path will also be relative to the configured HTTP root */ @ApplicationPath("/bar") - public static class BarApp extends Application { + public static class BarApp extends BaseApplication { + } + + public static abstract class BaseApplication extends Application { } @Test diff --git a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java index 6f29e1e62a4d2..55b2e9c5a6d35 100644 --- a/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java +++ b/independent-projects/resteasy-reactive/common/processor/src/main/java/org/jboss/resteasy/reactive/common/processor/scanning/ResteasyReactiveScanner.java @@ -59,6 +59,9 @@ public static ApplicationScanningResult scanForApplicationClass(IndexView index, ClassInfo selectedAppClass = null; boolean blocking = false; for (ClassInfo applicationClassInfo : applications) { + if (Modifier.isAbstract(applicationClassInfo.flags())) { + continue; + } if (selectedAppClass != null) { throw new RuntimeException("More than one Application class: " + applications); }