java - Quarkus Reactive - 名称“security.jaxrs.deny-unannotated-endpoints”的多个匹配属性错误
问题描述
使用 Quarkus 我在执行时收到以下错误:
引起:java.lang.IllegalArgumentException:名称“security.jaxrs.deny-unannotated-endpoints”属性的多个匹配属性由公共布尔 io.quarkus.resteasy.reactive.common.runtime.JaxRsSecurityConfig.denyJaxRs 和公共布尔匹配io.quarkus.resteasy.runtime.JaxRsSecurityConfig.denyJaxRs。这可能是因为您有一个不兼容的扩展组合,它们都定义了相同的属性(例如,包括反应式和阻塞式数据库扩展)
我的 pom 属性是:
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>12</maven.compiler.source>
<maven.compiler.target>12</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus-plugin.version>1.13.3.Final</quarkus-plugin.version>
<quarkus.platform.artifact-id>quarkus-universe-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>1.13.3.Final</quarkus.platform.version>
和依赖:
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-mutiny</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-vertx</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jsonb</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-mutiny</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-client-reactive</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-jwt</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-smallrye-jwt-build</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-arc</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
我只是尝试使用 Multi from mutiny 和Server Sent Elements进行流式传输:
@GET
@Produces(MediaType.SERVER_SENT_EVENTS)
@RestSseElementType(MediaType.TEXT_PLAIN)
@Path("/stream/{count}/{name}")
public Multi<String> greetingsAsStream(int count, String name) {
return service.greetings(count, name);
}
解决方案
您同时拥有经典的 RESTEasy ( quarkus-resteasy-jsonb
, quarkus-resteasy-mutiny
) 和 RESTEasy Reactive ( quarkus-resteasy-reactive
)。你需要选择一个并坚持下去。
例如,如果您想要 RESTEasy Reactive,您将删除quarkus-resteasy-mutiny
(不需要额外依赖 RESTEasy Reactive),并替换quarkus-resteasy-jsonb
为quarkus-resteasy-reactive-jsonb
.
推荐阅读
- javascript - 从 mxGraph 导出为 PNG 图像
- php - 将参数作为数组传递给 call_user_func_array() 时如何在一个数组中接收参数
- api - 文本翻译 API 正在翻译 URL
- django - Django 单击后,URL 更改,但页面未加载
- javascript - 从javascript数组或变量将数据传递给highcharts
- mysql - 如何通过laravel中的视图计算表中的用户数?
- c# - 如何覆盖现有 Excel 文件的工作表
- javascript - API 的 Javascript 效率
- javascript - Angular 7 - 创建具有角度样式的隔离范围的组件背后的机制是什么?
- reactjs - 通过包装组件控制 Flatpickr 日历视图的打开/关闭