3

使用 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);
}
4

2 回答 2

8

您同时拥有经典的 RESTEasy ( quarkus-resteasy-jsonb, quarkus-resteasy-mutiny) 和 RESTEasy Reactive ( quarkus-resteasy-reactive)。你需要选择一个并坚持下去。

例如,如果您想要 RESTEasy Reactive,您将删除quarkus-resteasy-mutiny(不需要额外依赖 RESTEasy Reactive),并替换quarkus-resteasy-jsonbquarkus-resteasy-reactive-jsonb.

于 2021-05-12T12:45:41.833 回答
0
I am facing a similar problem:

java.lang.RuntimeException:java.lang.IllegalArgumentException:名称“security.jaxrs.deny-unannotated-endpoints”属性的多个匹配属性由两个公共布尔 io.quarkus.resteasy.reactive.common.runtime.JaxRsSecurityConfig.denyJaxRs 匹配和公共布尔 io.quarkus.resteasy.runtime.JaxRsSecurityConfig.denyJaxRs。这可能是因为您有一个不兼容的扩展组合,它们都定义了相同的属性(例如,包括反应式和阻塞式数据库扩展)

I am using Swagger OpenAPIGenerate:

generatorName.set("jaxrs-spec")

Gradle dependencies:

依赖{

 implementation(Libs.quarkus_resteasy){
    exclude(group = "io-quarkus", module = "quarkus-resteasy-runtime")
}
 implementationList(LibGroups.quarkus_rest_server)
}
 Libs.quarkus_resteasy
>  val quarkus_resteasy = "io.quarkus:quarkus-resteasy"

LibGroups.quarkus_rest_server
>val quarkus_rest_server = listOf(
> >     "io.quarkus:quarkus-vertx",
> >     "io.quarkus:quarkus-resteasy-reactive-jackson"      
> >     //"io.quarkus:quarkus-resteasy-reactive"
>  )

After excluding the clashing module, I am still getting the same error. 
Any poin
于 2021-05-14T22:32:57.147 回答