diff --git a/extensions/resteasy-classic/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java b/extensions/resteasy-classic/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java index f7c82dac4244f..965d7218bd412 100755 --- a/extensions/resteasy-classic/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java +++ b/extensions/resteasy-classic/resteasy-server-common/deployment/src/main/java/io/quarkus/resteasy/server/common/deployment/ResteasyServerCommonProcessor.java @@ -953,6 +953,9 @@ private static Set getAllowedClasses(IndexView index) { Application application; ClassInfo selectedAppClass = null; for (ClassInfo applicationClassInfo : applications) { + if (Modifier.isAbstract(applicationClassInfo.flags())) { + continue; + } if (selectedAppClass != null) { throw new RuntimeException("More than one Application class: " + applications); } diff --git a/extensions/resteasy-classic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/root/ApplicationPathHttpRootTest.java b/extensions/resteasy-classic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/root/ApplicationPathHttpRootTest.java index 932d8a26f9097..7119705b9ae3c 100644 --- a/extensions/resteasy-classic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/root/ApplicationPathHttpRootTest.java +++ b/extensions/resteasy-classic/resteasy/deployment/src/test/java/io/quarkus/resteasy/test/root/ApplicationPathHttpRootTest.java @@ -23,7 +23,7 @@ public class ApplicationPathHttpRootTest { @RegisterExtension static QuarkusUnitTest runner = new QuarkusUnitTest() .setArchiveProducer(() -> ShrinkWrap.create(JavaArchive.class) - .addClasses(HelloResource.class, HelloApp.class) + .addClasses(HelloResource.class, HelloApp.class, BaseApplication.class) .addAsResource(new StringAsset("quarkus.http.root-path=/foo"), "application.properties")); @Test @@ -44,7 +44,11 @@ public String hello() { } @ApplicationPath("hello") - public static class HelloApp extends Application { + public static class HelloApp extends BaseApplication { + + } + + public static abstract class BaseApplication extends Application { } 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); }