From dedd2c772b6e4ea0c2570a295d9964970dd7017e Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Wed, 24 Feb 2021 17:02:29 +0200 Subject: [PATCH 01/10] Treat MismatchedInputException as client error in RESTEasy Reactive The Javadoc of MismatchedInputException even mentions that these exceptions should be treated as client exceptions Relates to: #15302 (cherry picked from commit fb3e87d0369b1567b0f86f19fb6aa0e98b6013c9) --- .../deployment/test/ExceptionInReaderTest.java | 4 +--- .../serialisers/JacksonMessageBodyReader.java | 11 +++++++++-- .../server/core/ResteasyReactiveRequestContext.java | 13 +++++++++++++ .../reactive/server/spi/ServerRequestContext.java | 3 +++ 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/deployment/src/test/java/io/quarkus/resteasy/reactive/jackson/deployment/test/ExceptionInReaderTest.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/deployment/src/test/java/io/quarkus/resteasy/reactive/jackson/deployment/test/ExceptionInReaderTest.java index 88064e308895e..f2beddab345e0 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/deployment/src/test/java/io/quarkus/resteasy/reactive/jackson/deployment/test/ExceptionInReaderTest.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/deployment/src/test/java/io/quarkus/resteasy/reactive/jackson/deployment/test/ExceptionInReaderTest.java @@ -1,7 +1,5 @@ package io.quarkus.resteasy.reactive.jackson.deployment.test; -import static org.hamcrest.CoreMatchers.containsString; - import java.util.function.Supplier; import org.jboss.shrinkwrap.api.ShrinkWrap; @@ -27,6 +25,6 @@ public JavaArchive get() { @Test public void test() { RestAssured.with().contentType("application/json").body("{\"name\": \"brie\"}").put("/fromage") - .then().statusCode(500).body(containsString("MismatchedInputException")); + .then().statusCode(400); } } diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/runtime/src/main/java/io/quarkus/resteasy/reactive/jackson/runtime/serialisers/JacksonMessageBodyReader.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/runtime/src/main/java/io/quarkus/resteasy/reactive/jackson/runtime/serialisers/JacksonMessageBodyReader.java index 657dca50a20f0..99248389396f4 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/runtime/src/main/java/io/quarkus/resteasy/reactive/jackson/runtime/serialisers/JacksonMessageBodyReader.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-jackson/runtime/src/main/java/io/quarkus/resteasy/reactive/jackson/runtime/serialisers/JacksonMessageBodyReader.java @@ -9,6 +9,7 @@ import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; import org.jboss.resteasy.reactive.common.util.EmptyInputStream; import org.jboss.resteasy.reactive.server.providers.serialisers.json.AbstractJsonMessageBodyReader; @@ -16,6 +17,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectReader; +import com.fasterxml.jackson.databind.exc.MismatchedInputException; public class JacksonMessageBodyReader extends AbstractJsonMessageBodyReader { @@ -29,13 +31,18 @@ public JacksonMessageBodyReader(ObjectMapper mapper) { @Override public Object readFrom(Class type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap httpHeaders, InputStream entityStream) throws IOException, WebApplicationException { - return doReadFrom(type, genericType, entityStream); + throw new IllegalStateException("Should never be called"); } @Override public Object readFrom(Class type, Type genericType, MediaType mediaType, ServerRequestContext context) throws WebApplicationException, IOException { - return doReadFrom(type, genericType, context.getInputStream()); + try { + return doReadFrom(type, genericType, context.getInputStream()); + } catch (MismatchedInputException e) { + context.abortWith(Response.status(Response.Status.BAD_REQUEST).build()); + return null; + } } private Object doReadFrom(Class type, Type genericType, InputStream entityStream) throws IOException { diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/ResteasyReactiveRequestContext.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/ResteasyReactiveRequestContext.java index 4b39cb279218d..dd8d3106ac44d 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/ResteasyReactiveRequestContext.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/core/ResteasyReactiveRequestContext.java @@ -178,6 +178,19 @@ public void restart(RuntimeResource target, boolean setLocatorTarget) { this.target = target; } + /** + * Meant to be used when a error occurred early in processing chain + */ + @Override + public void abortWith(Response response) { + setResult(response); + restart(getAbortHandlerChain()); + // this is a valid action after suspend, in which case we must resume + if (isSuspended()) { + resume(); + } + } + /** * Resets the build time serialization assumptions. Called if a filter * modifies the response diff --git a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/spi/ServerRequestContext.java b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/spi/ServerRequestContext.java index f4e0df4ea4a76..f0f0d51cd21dc 100644 --- a/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/spi/ServerRequestContext.java +++ b/independent-projects/resteasy-reactive/server/runtime/src/main/java/org/jboss/resteasy/reactive/server/spi/ServerRequestContext.java @@ -3,6 +3,7 @@ import java.io.InputStream; import java.io.OutputStream; import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import org.jboss.resteasy.reactive.common.core.ResteasyReactiveCallbackContext; public interface ServerRequestContext extends ResteasyReactiveCallbackContext { @@ -18,4 +19,6 @@ public interface ServerRequestContext extends ResteasyReactiveCallbackContext { OutputStream getOrCreateOutputStream(); ResteasyReactiveResourceInfo getResteasyReactiveResourceInfo(); + + void abortWith(Response response); } From 05b5a5070ede39c57d099b0d5f2c99f36e3b7ad5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Feb 2021 15:33:17 +0000 Subject: [PATCH 02/10] Bump kubernetes-client-bom from 5.1.0 to 5.1.1 Bumps [kubernetes-client-bom](https://github.com/fabric8io/kubernetes-client) from 5.1.0 to 5.1.1. - [Release notes](https://github.com/fabric8io/kubernetes-client/releases) - [Changelog](https://github.com/fabric8io/kubernetes-client/blob/master/CHANGELOG.md) - [Commits](https://github.com/fabric8io/kubernetes-client/compare/v5.1.0...v5.1.1) Signed-off-by: dependabot[bot] (cherry picked from commit f9a61adcccd9eeb614b51f326186599d2ce5cb67) --- bom/application/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/application/pom.xml b/bom/application/pom.xml index ea5a27a9bf6fa..66f0392cfb6df 100644 --- a/bom/application/pom.xml +++ b/bom/application/pom.xml @@ -173,7 +173,7 @@ 4.1.0 3.1.7 0.1.0 - 5.1.0 + 5.1.1 2.2.0 5.2.SP4 2.1.SP2 From 3aaa1bd52562933132a4a381b5590b1031a8076f Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 1 Mar 2021 15:03:07 +0200 Subject: [PATCH 03/10] Bring back proper timing for quarkus:dev This seems to have been (erroneously) removed in 3a6b561c35f66ffe6d4fdfacac5ca2780aea8bb3 Fixes: #15371 (cherry picked from commit a335c6b6a54b7ead8a9ab9f2bf44a23f604ac939) --- .../main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java | 1 + 1 file changed, 1 insertion(+) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java index ee2baa7a20b84..6dc5207d5fa9d 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/dev/IsolatedDevModeMain.java @@ -297,6 +297,7 @@ public void close() { //the main entry point, but loaded inside the augmentation class loader @Override public void accept(CuratedApplication o, Map params) { + Timing.staticInitStarted(o.getBaseRuntimeClassLoader()); //https://github.com/quarkusio/quarkus/issues/9748 //if you have an app with all daemon threads then the app thread //may be the only thread keeping the JVM alive From 97f0888aaf146737aef3db8cefadab548b32029b Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 1 Mar 2021 14:22:45 +0200 Subject: [PATCH 04/10] Avoid warning about indexing primitive types See: https://quarkusio.zulipchat.com/#narrow/stream/187030-users/topic/Failed.20to.20index.20byte.20-.201.2E12.2E0.2EFinal.20and.20smallrye-openapi/near/228152783 (cherry picked from commit 887bc14c8b0a73dc391d4e2c3bb2c0d8542ac43e) --- .../io/quarkus/arc/processor/BeanArchives.java | 3 +++ .../java/io/quarkus/arc/processor/Types.java | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanArchives.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanArchives.java index d90f162a2273e..2e2203cd67eac 100644 --- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanArchives.java +++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/BeanArchives.java @@ -244,6 +244,9 @@ static boolean index(Indexer indexer, String className) { static boolean index(Indexer indexer, String className, ClassLoader classLoader) { boolean result = false; + if (Types.isPrimitiveClassName(className)) { + return false; + } try (InputStream stream = classLoader .getResourceAsStream(className.replace('.', '/') + ".class")) { if (stream != null) { diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Types.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Types.java index fc01ab5fe3ecf..d64fc27a971d9 100644 --- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Types.java +++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/Types.java @@ -46,6 +46,19 @@ final class Types { private static final Type OBJECT_TYPE = Type.create(DotNames.OBJECT, Kind.CLASS); + private static final Set PRIMITIVE_CLASS_NAMES = new HashSet<>(); + + static { + PRIMITIVE_CLASS_NAMES.add("byte"); + PRIMITIVE_CLASS_NAMES.add("char"); + PRIMITIVE_CLASS_NAMES.add("double"); + PRIMITIVE_CLASS_NAMES.add("float"); + PRIMITIVE_CLASS_NAMES.add("int"); + PRIMITIVE_CLASS_NAMES.add("long"); + PRIMITIVE_CLASS_NAMES.add("short"); + PRIMITIVE_CLASS_NAMES.add("boolean"); + } + // we ban these interfaces because they are new to Java 12 and are used by java.lang.String which // means that they cannot be included in bytecode if we want to have application built with Java 12+ but targeting Java 8 - 11 // actually run on those older versions @@ -405,4 +418,8 @@ static Type box(Primitive primitive) { } } + static boolean isPrimitiveClassName(String className) { + return PRIMITIVE_CLASS_NAMES.contains(className); + } + } From af1c4ce79447a37db7ba2433b1f5065fef719141 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Mon, 1 Mar 2021 15:21:06 +1100 Subject: [PATCH 05/10] Fix sub resource locators with no method annotations Fixes #15357 (cherry picked from commit 01284d3d9491d89961da1b8f59e0fab53b75a4fd) --- .../server/deployment/ResteasyReactiveProcessor.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java index 9cf67a0feaed9..7ef67365b415d 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/java/io/quarkus/resteasy/reactive/server/deployment/ResteasyReactiveProcessor.java @@ -403,6 +403,15 @@ private boolean hasAnnotation(MethodInfo method, short paramPosition, DotName an toScan.add(classInfo); } } + //sub resources can also have just a path annotation + //if they are 'intermediate' sub resources + for (AnnotationInstance instance : index.getAnnotations(ResteasyReactiveDotNames.PATH)) { + if (instance.target().kind() == AnnotationTarget.Kind.METHOD) { + MethodInfo method = instance.target().asMethod(); + ClassInfo classInfo = method.declaringClass(); + toScan.add(classInfo); + } + } while (!toScan.isEmpty()) { ClassInfo classInfo = toScan.poll(); if (scannedResources.containsKey(classInfo.name()) || From e080a65e1ed634b6c85a4faf2fa6b558211e9ece Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Mon, 1 Mar 2021 12:05:05 +0100 Subject: [PATCH 06/10] Avoid NPE in dev console when there aren't any indexed entities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yoann Rodière (cherry picked from commit 7cc0be54904b9b4c21e85e2113ae3943a5ca6d0c) --- .../devconsole/HibernateSearchDevConsoleRecorder.java | 11 ++++++++--- .../runtime/devconsole/HibernateSearchSupplier.java | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchDevConsoleRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchDevConsoleRecorder.java index cd49ef9553ef3..8fd3fa32ad1f4 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchDevConsoleRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchDevConsoleRecorder.java @@ -7,6 +7,7 @@ import org.hibernate.search.mapper.orm.mapping.SearchMapping; import io.quarkus.devconsole.runtime.spi.DevConsolePostHandler; +import io.quarkus.devconsole.runtime.spi.FlashScopeUtil; import io.quarkus.runtime.annotations.Recorder; import io.vertx.core.Handler; import io.vertx.core.MultiMap; @@ -22,9 +23,13 @@ protected void handlePostAsync(RoutingContext event, MultiMap form) throws Excep if (form.isEmpty()) { return; } - SearchMapping searchMapping = HibernateSearchSupplier.searchMapping(); - searchMapping.scope(Object.class, - searchMapping.allIndexedEntities().stream() + SearchMapping mapping = HibernateSearchSupplier.searchMapping(); + if (mapping == null) { + flashMessage(event, "There aren't any indexed entities!", FlashScopeUtil.FlashMessageStatus.ERROR); + return; + } + mapping.scope(Object.class, + mapping.allIndexedEntities().stream() .map(SearchIndexedEntity::jpaName) .filter(form::contains) .collect(Collectors.toList())) diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchSupplier.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchSupplier.java index 4666a20a0f97f..1f6cb8579a691 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchSupplier.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchSupplier.java @@ -1,5 +1,6 @@ package io.quarkus.hibernate.search.orm.elasticsearch.runtime.devconsole; +import java.util.Collections; import java.util.List; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -12,7 +13,11 @@ public class HibernateSearchSupplier implements Supplier> { @Override public List get() { - return searchMapping().allIndexedEntities().stream().map(SearchIndexedEntity::jpaName).sorted() + SearchMapping mapping = searchMapping(); + if (mapping == null) { + return Collections.emptyList(); + } + return mapping.allIndexedEntities().stream().map(SearchIndexedEntity::jpaName).sorted() .collect(Collectors.toList()); } From dd39a8ae871005bc4e9c0a8d37622dd6cf9735bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Mon, 1 Mar 2021 13:29:05 +0100 Subject: [PATCH 07/10] Avoid confusion between entity instances and entity types in the HSearch devcard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yoann Rodière (cherry picked from commit 05e7d506899fbf7d4d3b6b50684ae107b9630a27) --- .../orm/elasticsearch/devconsole/DevConsoleProcessor.java | 4 ++-- .../src/main/resources/dev-templates/embedded.html | 4 ++-- .../dev-templates/{entities.html => entity-types.html} | 8 ++++---- .../devconsole/HibernateSearchDevConsoleRecorder.java | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) rename extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/{entities.html => entity-types.html} (85%) diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/devconsole/DevConsoleProcessor.java b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/devconsole/DevConsoleProcessor.java index 94d1c46300e91..a4e2f90932ed4 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/devconsole/DevConsoleProcessor.java +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/devconsole/DevConsoleProcessor.java @@ -14,12 +14,12 @@ public class DevConsoleProcessor { @BuildStep(onlyIf = IsDevelopment.class) public DevConsoleRuntimeTemplateInfoBuildItem collectBeanInfo() { - return new DevConsoleRuntimeTemplateInfoBuildItem("entities", new HibernateSearchSupplier()); + return new DevConsoleRuntimeTemplateInfoBuildItem("entityTypes", new HibernateSearchSupplier()); } @BuildStep @Record(value = STATIC_INIT, optional = true) DevConsoleRouteBuildItem invokeEndpoint(HibernateSearchDevConsoleRecorder recorder) { - return new DevConsoleRouteBuildItem("entities", "POST", recorder.indexEntity()); + return new DevConsoleRouteBuildItem("entity-types", "POST", recorder.indexEntity()); } } diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/embedded.html b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/embedded.html index 192a385b27b1a..7f7027a3cb8cc 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/embedded.html +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/embedded.html @@ -1,4 +1,4 @@ - + - Indexed entities {info:entities.size()} + Indexed entity types {info:entityTypes.size()}
diff --git a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entities.html b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entity-types.html similarity index 85% rename from extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entities.html rename to extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entity-types.html index 3f81b7ba4ba15..a257afacb8225 100644 --- a/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entities.html +++ b/extensions/hibernate-search-orm-elasticsearch/deployment/src/main/resources/dev-templates/entity-types.html @@ -11,18 +11,18 @@ - Entity + Entity type - {#for entity in info:entities} + {#for entityType in info:entityTypes}
- +
- {entity} + {entityType} {/for} diff --git a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchDevConsoleRecorder.java b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchDevConsoleRecorder.java index 8fd3fa32ad1f4..c472dac77e565 100644 --- a/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchDevConsoleRecorder.java +++ b/extensions/hibernate-search-orm-elasticsearch/runtime/src/main/java/io/quarkus/hibernate/search/orm/elasticsearch/runtime/devconsole/HibernateSearchDevConsoleRecorder.java @@ -25,7 +25,7 @@ protected void handlePostAsync(RoutingContext event, MultiMap form) throws Excep } SearchMapping mapping = HibernateSearchSupplier.searchMapping(); if (mapping == null) { - flashMessage(event, "There aren't any indexed entities!", FlashScopeUtil.FlashMessageStatus.ERROR); + flashMessage(event, "There aren't any indexed entity types!", FlashScopeUtil.FlashMessageStatus.ERROR); return; } mapping.scope(Object.class, From 1105aa6367ce2a81681bd257beadfb23f38f7267 Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Tue, 2 Mar 2021 08:43:44 +0200 Subject: [PATCH 08/10] Include quarkus-mutiny instead of vanilla mutiny in RESTEasy Reactive Fixes: #15400 (cherry picked from commit 2b0d8017630986077f7a4812905eca00c83d9d6c) --- .../quarkus-resteasy-reactive-common/deployment/pom.xml | 4 ++++ .../quarkus-resteasy-reactive-common/runtime/pom.xml | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/pom.xml index 7ad661eb8b618..dd4841d3ac674 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/deployment/pom.xml @@ -25,6 +25,10 @@ io.quarkus quarkus-arc-deployment + + io.quarkus + quarkus-mutiny-deployment + io.quarkus quarkus-resteasy-reactive-common diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/pom.xml b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/pom.xml index 55c2f6156cc87..abe382006375c 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/pom.xml +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-common/runtime/pom.xml @@ -23,8 +23,8 @@ jboss-jaxrs-api_2.1_spec - io.smallrye.reactive - mutiny + io.quarkus + quarkus-mutiny io.quarkus From 9df0c280aa0841a00809322298d5077bca6b5ba8 Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Tue, 2 Mar 2021 18:25:06 +0800 Subject: [PATCH 09/10] Fix consumes in rest score template;add consumes in endpoints template (cherry picked from commit ab9d37a0290448962fdcff982eb3c7401c100d92) --- .../src/main/resources/dev-templates/endpoints.html | 13 ++++++++++++- .../src/main/resources/dev-templates/scores.html | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/resources/dev-templates/endpoints.html b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/resources/dev-templates/endpoints.html index a27b53dea5057..515cb913f46a0 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/resources/dev-templates/endpoints.html +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/resources/dev-templates/endpoints.html @@ -27,6 +27,17 @@
REST Resources
{/if} + {#if !endpoint.consumes.isEmpty()} +
+
+
+ Consumes +
+
+ {endpoint.consumes} +
+
+ {/if} {/for}
Static Resources
{#for staticResources in info:staticResourcesInfo} @@ -49,4 +60,4 @@
Additional Endpoints
{/for} {/body} -{/include} \ No newline at end of file +{/include} diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/resources/dev-templates/scores.html b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/resources/dev-templates/scores.html index 158cc7efd771d..caad74da707ce 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/resources/dev-templates/scores.html +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive/deployment/src/main/resources/dev-templates/scores.html @@ -28,7 +28,7 @@ Consumes
- {endpoint.produces} + {endpoint.consumes}
{/if} From b3440e77ac2e2d16380a5b0181fe8a979ccfd2e6 Mon Sep 17 00:00:00 2001 From: Stuart Douglas Date: Tue, 2 Mar 2021 16:59:55 +1100 Subject: [PATCH 10/10] Make missing password and error If the URL is set but no password this is clearly a config error. (cherry picked from commit 184a8b26d3e4155e1139c15ea47228010d3d4af4) --- .../http/deployment/devmode/HttpRemoteDevClientProvider.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/HttpRemoteDevClientProvider.java b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/HttpRemoteDevClientProvider.java index f9884b031d8d6..b279ae15ca9f8 100644 --- a/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/HttpRemoteDevClientProvider.java +++ b/extensions/vertx-http/deployment/src/main/java/io/quarkus/vertx/http/deployment/devmode/HttpRemoteDevClientProvider.java @@ -28,9 +28,8 @@ public Optional getClient() { return Optional.empty(); } if (!liveReloadConfig.password.isPresent()) { - log.warn( + throw new RuntimeException( "Live reload URL set but no password, remote dev requires a password, set quarkus.live-reload.password on both server and client"); - return Optional.empty(); } return Optional.of(new HttpRemoteDevClient(liveReloadConfig.url.get(), liveReloadConfig.password.get())); }