未找到功能性渠道服务提供者。尝试添加对 grpc-okhttp、grpc-netty 或 grpc-netty-shaded 工件的依赖项

Posted

技术标签:

【中文标题】未找到功能性渠道服务提供者。尝试添加对 grpc-okhttp、grpc-netty 或 grpc-netty-shaded 工件的依赖项【英文标题】:No functional channel service provider found. Try adding a dependency on the grpc-okhttp, grpc-netty, or grpc-netty-shaded artifact 【发布时间】:2021-09-23 13:30:00 【问题描述】:

我正在尝试以本机模式运行 Quarkus 应用程序。在 jvm 上运行时它工作正常,但在本机运行时它在启动后立即崩溃。已经尝试过不同版本的 io.grpc.* 库,但没有成功。

我正在使用 Quarkus 2.0.1.Final,带有 graalvm-ce-java11-21.1.0

2021-07-14 11:11:19,224 INFO  [io.quarkus] (main) Installed features: [cdi, oidc-client, oidc-client-filter, rest-client, rest-client-jackson, resteasy-jackson, smallrye-context-propagation, smallrye-health]
2021-07-14 11:11:19,226 ERROR [io.qua.run.Application] (main) Failed to start application (with profile prod): io.grpc.ManagedChannelProvider$ProviderNotFoundException: No functional channel service provider found. Try adding a dependency on the grpc-okhttp, grpc-netty, or grpc-netty-shaded artifact
        at io.grpc.ManagedChannelProvider.provider(ManagedChannelProvider.java:43)
        at io.grpc.ManagedChannelBuilder.forAddress(ManagedChannelBuilder.java:39)
        at com.aaa.bbb.eventbus.EventBusFactory.createManagedChannel(EventBusFactory.java:42)
        at com.aaa.bbb.eventbus.EventBusFactory_ProducerMethod_createManagedChannel_149b127e61d711c80a2cb8180e6db

代码中的失败部分是 Producer for ManagedChannel,其定义如下:


    @Produces
    public ManagedChannel createManagedChannel(final Config config)
    
        var environment = config.getEventBusEnvironment();

        return ManagedChannelBuilder
                .forAddress(environment.getServer(), environment.getPort())
                .useTransportSecurity()
                .build();
    

这是我的项目的依赖树:


NFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ msp-bbb-events-consumer-router ---
[INFO] com.aaa:msp-bbb-events-consumer-router:jar:0.0.9-SNAPSHOT
[INFO] +- io.quarkus:quarkus-arc:jar:2.0.1.Final:compile
[INFO] |  +- io.quarkus.arc:arc:jar:2.0.1.Final:compile
[INFO] |  |  +- jakarta.enterprise:jakarta.enterprise.cdi-api:jar:2.0.2:compile
[INFO] |  |  |  \- jakarta.el:jakarta.el-api:jar:3.0.3:compile
[INFO] |  |  +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] |  |  +- jakarta.transaction:jakarta.transaction-api:jar:1.3.3:compile
[INFO] |  |  \- org.jboss.logging:jboss-logging:jar:3.4.2.Final:compile
[INFO] |  +- io.quarkus:quarkus-core:jar:2.0.1.Final:compile
[INFO] |  |  +- jakarta.inject:jakarta.inject-api:jar:1.0:compile
[INFO] |  |  +- io.quarkus:quarkus-ide-launcher:jar:2.0.1.Final:compile
[INFO] |  |  +- io.quarkus:quarkus-development-mode-spi:jar:2.0.1.Final:compile
[INFO] |  |  +- io.smallrye.config:smallrye-config:jar:2.3.0:compile
[INFO] |  |  |  \- io.smallrye.config:smallrye-config-core:jar:2.3.0:compile
[INFO] |  |  |     +- org.eclipse.microprofile.config:microprofile-config-api:jar:2.0:compile
[INFO] |  |  |     +- io.smallrye.common:smallrye-common-expression:jar:1.6.0:compile
[INFO] |  |  |     |  \- io.smallrye.common:smallrye-common-function:jar:1.6.0:compile
[INFO] |  |  |     +- io.smallrye.common:smallrye-common-constraint:jar:1.6.0:compile
[INFO] |  |  |     +- io.smallrye.common:smallrye-common-classloader:jar:1.6.0:compile
[INFO] |  |  |     \- io.smallrye.config:smallrye-config-common:jar:2.3.0:compile
[INFO] |  |  +- org.jboss.logmanager:jboss-logmanager-embedded:jar:1.0.9:compile
[INFO] |  |  +- org.jboss.logging:jboss-logging-annotations:jar:2.2.1.Final:compile
[INFO] |  |  +- org.jboss.threads:jboss-threads:jar:3.4.0.Final:compile
[INFO] |  |  +- org.jboss.slf4j:slf4j-jboss-logmanager:jar:1.1.0.Final:compile
[INFO] |  |  +- org.graalvm.sdk:graal-sdk:jar:21.1.0:compile
[INFO] |  |  +- org.wildfly.common:wildfly-common:jar:1.5.4.Final-format-001:compile
[INFO] |  |  \- io.quarkus:quarkus-bootstrap-runner:jar:2.0.1.Final:compile
[INFO] |  \- org.eclipse.microprofile.context-propagation:microprofile-context-propagation-api:jar:1.2:compile
[INFO] +- io.quarkus:quarkus-resteasy:jar:2.0.1.Final:compile
[INFO] |  +- io.quarkus:quarkus-vertx-http:jar:2.0.1.Final:compile
[INFO] |  |  +- io.quarkus:quarkus-security-runtime-spi:jar:2.0.1.Final:compile
[INFO] |  |  +- io.quarkus:quarkus-vertx-http-dev-console-runtime-spi:jar:2.0.1.Final:compile
[INFO] |  |  +- io.quarkus.security:quarkus-security:jar:1.1.4.Final:compile
[INFO] |  |  +- io.quarkus:quarkus-vertx-core:jar:2.0.1.Final:compile
[INFO] |  |  |  +- io.quarkus:quarkus-netty:jar:2.0.1.Final:compile
[INFO] |  |  |  |  +- io.netty:netty-codec:jar:4.1.65.Final:compile
[INFO] |  |  |  |  +- io.netty:netty-codec-http:jar:4.1.65.Final:compile
[INFO] |  |  |  |  +- io.netty:netty-codec-http2:jar:4.1.65.Final:compile
[INFO] |  |  |  |  \- io.netty:netty-handler:jar:4.1.65.Final:compile
[INFO] |  |  |  +- io.netty:netty-codec-haproxy:jar:4.1.65.Final:compile
[INFO] |  |  |  |  +- io.netty:netty-buffer:jar:4.1.65.Final:compile
[INFO] |  |  |  |  \- io.netty:netty-transport:jar:4.1.65.Final:compile
[INFO] |  |  |  \- io.vertx:vertx-core:jar:4.1.0:compile
[INFO] |  |  |     +- io.netty:netty-common:jar:4.1.65.Final:compile
[INFO] |  |  |     +- io.netty:netty-handler-proxy:jar:4.1.65.Final:compile
[INFO] |  |  |     |  \- io.netty:netty-codec-socks:jar:4.1.65.Final:compile
[INFO] |  |  |     +- io.netty:netty-resolver:jar:4.1.65.Final:compile
[INFO] |  |  |     \- io.netty:netty-resolver-dns:jar:4.1.65.Final:compile
[INFO] |  |  |        \- io.netty:netty-codec-dns:jar:4.1.65.Final:compile
[INFO] |  |  \- io.vertx:vertx-web:jar:4.1.0:compile
[INFO] |  |     +- io.vertx:vertx-web-common:jar:4.1.0:compile
[INFO] |  |     +- io.vertx:vertx-auth-common:jar:4.1.0:compile
[INFO] |  |     \- io.vertx:vertx-bridge-common:jar:4.1.0:compile
[INFO] |  \- io.quarkus:quarkus-resteasy-server-common:jar:2.0.1.Final:compile
[INFO] |     \- jakarta.validation:jakarta.validation-api:jar:2.0.2:compile
[INFO] +- io.quarkus:quarkus-resteasy-jackson:jar:2.0.1.Final:compile
[INFO] |  +- io.quarkus:quarkus-jackson:jar:2.0.1.Final:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.12.3:compile
[INFO] |  |  +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.12.3:compile
[INFO] |  |  \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.12.3:compile
[INFO] |  +- org.jboss.resteasy:resteasy-jackson2-provider:jar:4.6.1.Final:compile
[INFO] |  |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:jar:2.12.3:compile
[INFO] |  |  |  +- com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:jar:2.12.3:compile
[INFO] |  |  |  \- com.fasterxml.jackson.module:jackson-module-jaxb-annotations:jar:2.12.3:compile
[INFO] |  |  \- com.github.java-json-tools:json-patch:jar:1.13:compile
[INFO] |  |     +- com.github.java-json-tools:msg-simple:jar:1.2:compile
[INFO] |  |     |  \- com.github.java-json-tools:btf:jar:1.3:compile
[INFO] |  |     \- com.github.java-json-tools:jackson-coreutils:jar:2.0:compile
[INFO] |  \- org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec:jar:2.0.0.Final:compile
[INFO] +- io.quarkus:quarkus-rest-client:jar:2.0.1.Final:compile
[INFO] |  +- io.quarkus:quarkus-resteasy-common:jar:2.0.1.Final:compile
[INFO] |  |  +- org.jboss.resteasy:resteasy-core:jar:4.6.1.Final:compile
[INFO] |  |  |  +- org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec:jar:2.0.1.Final:compile
[INFO] |  |  |  +- org.jboss.resteasy:resteasy-core-spi:jar:4.6.1.Final:compile
[INFO] |  |  |  +- org.reactivestreams:reactive-streams:jar:1.0.3:compile
[INFO] |  |  |  \- com.ibm.async:asyncutil:jar:0.1.0:compile
[INFO] |  |  \- com.sun.activation:jakarta.activation:jar:1.2.1:compile
[INFO] |  +- io.quarkus:quarkus-apache-httpclient:jar:2.0.1.Final:compile
[INFO] |  +- org.jboss.resteasy:resteasy-client-microprofile:jar:4.6.1.Final:compile
[INFO] |  |  \- org.jboss.resteasy:resteasy-client-microprofile-base:jar:4.6.1.Final:compile
[INFO] |  |     +- org.jboss.resteasy:resteasy-client:jar:4.6.1.Final:compile
[INFO] |  |     |  \- org.jboss.resteasy:resteasy-client-api:jar:4.6.1.Final:compile
[INFO] |  |     +- org.jboss.resteasy:resteasy-cdi:jar:4.6.1.Final:compile
[INFO] |  |     |  \- org.jboss.weld:weld-api:jar:3.1.SP4:compile
[INFO] |  |     \- org.eclipse.microprofile.rest.client:microprofile-rest-client-api:jar:2.0:compile
[INFO] |  +- jakarta.interceptor:jakarta.interceptor-api:jar:1.2.5:compile
[INFO] |  +- org.apache.httpcomponents:httpasyncclient:jar:4.1.4:compile
[INFO] |  |  +- org.apache.httpcomponents:httpcore:jar:4.4.14:compile
[INFO] |  |  \- org.apache.httpcomponents:httpcore-nio:jar:4.4.14:compile
[INFO] |  \- org.jboss.logging:commons-logging-jboss-logging:jar:1.0.0.Final:compile
[INFO] +- io.quarkus:quarkus-rest-client-jackson:jar:2.0.1.Final:compile
[INFO] +- io.quarkus:quarkus-oidc-client:jar:2.0.1.Final:compile
[INFO] |  \- io.quarkus:quarkus-oidc-common:jar:2.0.1.Final:compile
[INFO] |     +- io.smallrye.reactive:smallrye-mutiny-vertx-web-client:jar:2.7.0:compile
[INFO] |     |  +- io.vertx:vertx-web-client:jar:4.1.0:compile
[INFO] |     |  +- io.smallrye.reactive:smallrye-mutiny-vertx-core:jar:2.7.0:compile
[INFO] |     |  |  +- io.smallrye.reactive:smallrye-mutiny-vertx-runtime:jar:2.7.0:compile
[INFO] |     |  |  \- io.smallrye.reactive:vertx-mutiny-generator:jar:2.7.0:compile
[INFO] |     |  |     \- io.vertx:vertx-codegen:jar:4.1.0:compile
[INFO] |     |  +- io.smallrye.reactive:smallrye-mutiny-vertx-auth-common:jar:2.7.0:compile
[INFO] |     |  \- io.smallrye.reactive:smallrye-mutiny-vertx-web-common:jar:2.7.0:compile
[INFO] |     \- io.quarkus:quarkus-smallrye-jwt-build:jar:2.0.1.Final:compile
[INFO] |        \- io.smallrye:smallrye-jwt-build:jar:3.2.0:compile
[INFO] |           +- org.eclipse.microprofile.jwt:microprofile-jwt-auth-api:jar:1.2:compile
[INFO] |           +- org.bitbucket.b_c:jose4j:jar:0.7.7:compile
[INFO] |           \- io.smallrye:smallrye-jwt-common:jar:3.2.0:compile
[INFO] +- io.quarkus:quarkus-oidc-client-filter:jar:2.0.1.Final:compile
[INFO] +- io.quarkus:quarkus-smallrye-health:jar:2.0.1.Final:compile
[INFO] |  +- io.smallrye:smallrye-health:jar:3.0.2:compile
[INFO] |  |  +- org.eclipse.microprofile.health:microprofile-health-api:jar:3.0:compile
[INFO] |  |  \- io.smallrye:smallrye-health-api:jar:3.0.2:compile
[INFO] |  |     \- io.smallrye.common:smallrye-common-annotation:jar:1.6.0:compile
[INFO] |  +- io.smallrye:smallrye-health-provided-checks:jar:3.0.2:compile
[INFO] |  \- io.quarkus:quarkus-jsonp:jar:2.0.1.Final:compile
[INFO] |     \- org.glassfish:jakarta.json:jar:1.1.6:compile
[INFO] +- io.quarkus:quarkus-junit5:jar:2.0.1.Final:test
[INFO] |  +- io.quarkus:quarkus-bootstrap-core:jar:2.0.1.Final:test
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-app-model:jar:2.0.1.Final:test
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-maven-resolver:jar:2.0.1.Final:test
[INFO] |  |  |  +- org.apache.maven:maven-embedder:jar:3.8.1:test
[INFO] |  |  |  |  +- org.apache.maven:maven-settings:jar:3.8.1:test
[INFO] |  |  |  |  +- org.apache.maven:maven-core:jar:3.8.1:test
[INFO] |  |  |  |  |  +- org.apache.maven:maven-artifact:jar:3.8.1:test
[INFO] |  |  |  |  |  \- org.codehaus.plexus:plexus-component-annotations:jar:2.1.0:test
[INFO] |  |  |  |  +- org.apache.maven:maven-plugin-api:jar:3.8.1:test
[INFO] |  |  |  |  +- org.apache.maven:maven-model:jar:3.8.1:test
[INFO] |  |  |  |  +- org.apache.maven:maven-model-builder:jar:3.8.1:test
[INFO] |  |  |  |  +- org.apache.maven:maven-builder-support:jar:3.8.1:test
[INFO] |  |  |  |  +- org.apache.maven.resolver:maven-resolver-api:jar:1.6.2:test
[INFO] |  |  |  |  +- org.apache.maven.resolver:maven-resolver-util:jar:1.6.2:test
[INFO] |  |  |  |  +- org.apache.maven.shared:maven-shared-utils:jar:3.3.3:test
[INFO] |  |  |  |  +- com.google.inject:guice:jar:no_aop:4.2.1:test
[INFO] |  |  |  |  +- org.codehaus.plexus:plexus-utils:jar:3.2.1:test
[INFO] |  |  |  |  +- org.codehaus.plexus:plexus-classworlds:jar:2.6.0:test
[INFO] |  |  |  |  \- commons-cli:commons-cli:jar:1.4:test
[INFO] |  |  |  +- org.eclipse.sisu:org.eclipse.sisu.plexus:jar:0.3.4:test
[INFO] |  |  |  +- org.apache.maven:maven-settings-builder:jar:3.8.1:test
[INFO] |  |  |  |  +- org.codehaus.plexus:plexus-interpolation:jar:1.25:test
[INFO] |  |  |  |  \- org.sonatype.plexus:plexus-sec-dispatcher:jar:1.4:test
[INFO] |  |  |  |     \- org.sonatype.plexus:plexus-cipher:jar:1.4:test
[INFO] |  |  |  +- org.apache.maven:maven-resolver-provider:jar:3.8.1:test
[INFO] |  |  |  |  +- org.apache.maven:maven-repository-metadata:jar:3.8.1:test
[INFO] |  |  |  |  +- org.apache.maven.resolver:maven-resolver-spi:jar:1.6.2:test
[INFO] |  |  |  |  \- org.apache.maven.resolver:maven-resolver-impl:jar:1.6.2:test
[INFO] |  |  |  +- org.apache.maven.resolver:maven-resolver-connector-basic:jar:1.6.2:test
[INFO] |  |  |  +- org.apache.maven.resolver:maven-resolver-transport-wagon:jar:1.6.2:test
[INFO] |  |  |  +- org.apache.maven.wagon:wagon-http:jar:3.4.3:test
[INFO] |  |  |  |  +- org.apache.maven.wagon:wagon-http-shared:jar:3.4.3:test
[INFO] |  |  |  |  |  \- org.jsoup:jsoup:jar:1.12.1:test
[INFO] |  |  |  |  \- org.apache.maven.wagon:wagon-provider-api:jar:3.4.3:test
[INFO] |  |  |  \- org.apache.maven.wagon:wagon-file:jar:3.4.3:test
[INFO] |  |  +- io.quarkus:quarkus-bootstrap-gradle-resolver:jar:2.0.1.Final:test
[INFO] |  |  \- io.smallrye.common:smallrye-common-io:jar:1.6.0:compile
[INFO] |  +- org.eclipse.sisu:org.eclipse.sisu.inject:jar:0.3.4:test
[INFO] |  +- io.quarkus:quarkus-test-common:jar:2.0.1.Final:test
[INFO] |  |  +- io.quarkus:quarkus-core-deployment:jar:2.0.1.Final:test
[INFO] |  |  |  +- org.aesh:readline:jar:2.1:test
[INFO] |  |  |  |  \- org.fusesource.jansi:jansi:jar:1.18:test
[INFO] |  |  |  +- io.quarkus.gizmo:gizmo:jar:1.0.9.Final:test
[INFO] |  |  |  |  \- org.ow2.asm:asm-util:jar:9.1:test
[INFO] |  |  |  |     +- org.ow2.asm:asm-tree:jar:9.1:test
[INFO] |  |  |  |     \- org.ow2.asm:asm-analysis:jar:9.1:test
[INFO] |  |  |  +- io.quarkus:quarkus-class-change-agent:jar:2.0.1.Final:test
[INFO] |  |  |  +- io.quarkus:quarkus-devtools-utilities:jar:2.0.1.Final:test
[INFO] |  |  |  +- io.quarkus:quarkus-builder:jar:2.0.1.Final:test
[INFO] |  |  |  \- org.junit.platform:junit-platform-launcher:jar:1.7.2:test
[INFO] |  |  +- io.quarkus:quarkus-jsonp-deployment:jar:2.0.1.Final:test
[INFO] |  |  \- org.jboss:jandex:jar:2.3.0.Final:test
[INFO] |  +- org.junit.jupiter:junit-jupiter:jar:5.7.2:test
[INFO] |  |  +- org.junit.jupiter:junit-jupiter-params:jar:5.7.2:test
[INFO] |  |  \- org.junit.jupiter:junit-jupiter-engine:jar:5.7.2:test
[INFO] |  |     \- org.junit.platform:junit-platform-engine:jar:1.7.2:test
[INFO] |  \- com.thoughtworks.xstream:xstream:jar:1.4.17:test
[INFO] |     \- io.github.x-stream:mxparser:jar:1.2.1:test
[INFO] |        \- xmlpull:xmlpull:jar:1.1.3.1:test
[INFO] +- io.quarkus:quarkus-junit5-mockito:jar:2.0.1.Final:test
[INFO] |  +- io.quarkus:quarkus-arc-deployment:jar:2.0.1.Final:test
[INFO] |  |  +- io.quarkus:quarkus-vertx-http-dev-console-spi:jar:2.0.1.Final:test
[INFO] |  |  \- io.quarkus.arc:arc-processor:jar:2.0.1.Final:test
[INFO] |  +- org.mockito:mockito-core:jar:3.10.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy:jar:1.11.0:test
[INFO] |  |  +- net.bytebuddy:byte-buddy-agent:jar:1.11.0:test
[INFO] |  |  \- org.objenesis:objenesis:jar:3.2:test
[INFO] |  \- io.quarkus:quarkus-mutiny:jar:2.0.1.Final:compile
[INFO] |     +- io.smallrye.reactive:mutiny:jar:0.17.0:compile
[INFO] |     +- io.quarkus:quarkus-smallrye-context-propagation:jar:2.0.1.Final:compile
[INFO] |     |  \- io.smallrye:smallrye-context-propagation:jar:1.2.0:compile
[INFO] |     |     +- io.smallrye:smallrye-context-propagation-api:jar:1.2.0:compile
[INFO] |     |     \- io.smallrye:smallrye-context-propagation-storage:jar:1.2.0:compile
[INFO] |     \- io.smallrye.reactive:mutiny-smallrye-context-propagation:jar:0.17.0:compile
[INFO] +- org.mockito:mockito-junit-jupiter:jar:3.11.2:test
[INFO] |  \- org.junit.jupiter:junit-jupiter-api:jar:5.7.2:test
[INFO] |     +- org.apiguardian:apiguardian-api:jar:1.1.0:test
[INFO] |     +- org.opentest4j:opentest4j:jar:1.2.0:test
[INFO] |     \- org.junit.platform:junit-platform-commons:jar:1.7.2:test
[INFO] +- io.rest-assured:rest-assured:jar:4.4.0:test
[INFO] |  +- org.codehaus.groovy:groovy:jar:3.0.8:test
[INFO] |  +- org.codehaus.groovy:groovy-xml:jar:3.0.8:test
[INFO] |  +- org.apache.httpcomponents:httpclient:jar:4.5.13:compile
[INFO] |  |  \- commons-codec:commons-codec:jar:1.15:compile
[INFO] |  +- org.apache.httpcomponents:httpmime:jar:4.5.13:test
[INFO] |  +- org.hamcrest:hamcrest:jar:2.1:test
[INFO] |  +- org.ccil.cowan.tagsoup:tagsoup:jar:1.2.1:test
[INFO] |  +- io.rest-assured:json-path:jar:4.4.0:test
[INFO] |  |  +- org.codehaus.groovy:groovy-json:jar:3.0.8:test
[INFO] |  |  \- io.rest-assured:rest-assured-common:jar:4.4.0:test
[INFO] |  \- io.rest-assured:xml-path:jar:4.4.0:test
[INFO] |     +- jakarta.xml.bind:jakarta.xml.bind-api:jar:2.3.3:test
[INFO] |     |  \- jakarta.activation:jakarta.activation-api:jar:1.2.1:compile
[INFO] |     \- com.sun.xml.bind:jaxb-impl:jar:2.3.3:test
[INFO] +- io.quarkus:quarkus-test-security:jar:2.0.1.Final:test
[INFO] |  \- io.quarkus:quarkus-security:jar:2.0.1.Final:test
[INFO] +- com.github.tomakehurst:wiremock-jre8:jar:2.28.0:test
[INFO] |  +- org.eclipse.jetty:jetty-server:jar:9.4.42.v20210604:test
[INFO] |  |  +- javax.servlet:javax.servlet-api:jar:3.1.0:test
[INFO] |  |  +- org.eclipse.jetty:jetty-http:jar:9.4.42.v20210604:test
[INFO] |  |  \- org.eclipse.jetty:jetty-io:jar:9.4.42.v20210604:test
[INFO] |  +- org.eclipse.jetty:jetty-servlet:jar:9.4.42.v20210604:test
[INFO] |  |  +- org.eclipse.jetty:jetty-security:jar:9.4.42.v20210604:test
[INFO] |  |  \- org.eclipse.jetty:jetty-util-ajax:jar:9.4.42.v20210604:test
[INFO] |  +- org.eclipse.jetty:jetty-servlets:jar:9.4.42.v20210604:test
[INFO] |  |  +- org.eclipse.jetty:jetty-continuation:jar:9.4.42.v20210604:test
[INFO] |  |  \- org.eclipse.jetty:jetty-util:jar:9.4.42.v20210604:test
[INFO] |  +- org.eclipse.jetty:jetty-webapp:jar:9.4.42.v20210604:test
[INFO] |  |  \- org.eclipse.jetty:jetty-xml:jar:9.4.42.v20210604:test
[INFO] |  +- org.eclipse.jetty:jetty-proxy:jar:9.4.42.v20210604:test
[INFO] |  |  \- org.eclipse.jetty:jetty-client:jar:9.4.42.v20210604:test
[INFO] |  +- org.eclipse.jetty.http2:http2-server:jar:9.4.42.v20210604:test
[INFO] |  |  \- org.eclipse.jetty.http2:http2-common:jar:9.4.42.v20210604:test
[INFO] |  |     \- org.eclipse.jetty.http2:http2-hpack:jar:9.4.42.v20210604:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-server:jar:9.4.42.v20210604:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-conscrypt-server:jar:9.4.42.v20210604:test
[INFO] |  +- org.eclipse.jetty:jetty-alpn-conscrypt-client:jar:9.4.42.v20210604:test
[INFO] |  |  \- org.eclipse.jetty:jetty-alpn-client:jar:9.4.42.v20210604:test
[INFO] |  +- org.conscrypt:conscrypt-openjdk-uber:jar:2.5.1:test
[INFO] |  +- com.google.guava:guava:jar:30.1.1-jre:compile
[INFO] |  |  +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] |  |  +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] |  |  +- org.checkerframework:checker-qual:jar:2.5.2:compile
[INFO] |  |  \- com.google.j2objc:j2objc-annotations:jar:1.3:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-core:jar:2.12.3:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.12.3:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-databind:jar:2.12.3:compile
[INFO] |  +- org.xmlunit:xmlunit-core:jar:2.8.2:test
[INFO] |  +- org.xmlunit:xmlunit-legacy:jar:2.8.2:test
[INFO] |  +- org.xmlunit:xmlunit-placeholders:jar:2.8.2:test
[INFO] |  +- net.javacrumbs.json-unit:json-unit-core:jar:2.25.0:test
[INFO] |  |  \- org.hamcrest:hamcrest-core:jar:2.2:test
[INFO] |  +- com.jayway.jsonpath:json-path:jar:2.4.0:test
[INFO] |  +- net.minidev:json-smart:jar:2.3:test
[INFO] |  |  \- net.minidev:accessors-smart:jar:1.2:test
[INFO] |  +- org.ow2.asm:asm:jar:9.1:test
[INFO] |  +- org.slf4j:slf4j-api:jar:1.7.30:compile
[INFO] |  +- net.sf.jopt-simple:jopt-simple:jar:5.0.4:test
[INFO] |  +- org.apache.commons:commons-lang3:jar:3.12.0:test
[INFO] |  +- com.github.jknack:handlebars:jar:4.2.0:test
[INFO] |  +- com.github.jknack:handlebars-helpers:jar:4.2.0:test
[INFO] |  +- commons-fileupload:commons-fileupload:jar:1.4:test
[INFO] |  \- commons-io:commons-io:jar:2.8.0:compile
[INFO] +- io.quarkus:quarkus-container-image-docker:jar:2.0.1.Final:compile
[INFO] |  \- io.quarkus:quarkus-container-image:jar:2.0.1.Final:compile
[INFO] +- com.ccc.davinci:eventbus-protocol:jar:v0.421.0:compile
[INFO] |  \- javax.annotation:javax.annotation-api:jar:1.3.2:compile
[INFO] +- com.ccc.cerberus:cerberus-grpc-java:jar:v0.13.0:compile
[INFO] |  +- com.google.oauth-client:google-oauth-client:jar:1.30.2:compile
[INFO] |  |  \- com.google.http-client:google-http-client:jar:1.38.0:compile
[INFO] |  |     +- io.opencensus:opencensus-api:jar:0.28.3:compile
[INFO] |  |     \- io.opencensus:opencensus-contrib-http-util:jar:0.24.0:compile
[INFO] |  +- com.google.http-client:google-http-client-jackson2:jar:1.38.0:compile
[INFO] |  \- io.grpc:grpc-core:jar:1.35.0:compile
[INFO] |     +- com.google.android:annotations:jar:4.1.1.4:runtime
[INFO] |     \- org.codehaus.mojo:animal-sniffer-annotations:jar:1.18:runtime
[INFO] +- org.apache.kafka:kafka-clients:jar:1.1.0:compile
[INFO] |  +- org.lz4:lz4-java:jar:1.6.0:compile
[INFO] |  \- org.xerial.snappy:snappy-java:jar:1.1.7.1:compile
[INFO] +- msp.event.schemas:ccc-protobuf-java:jar:0.64.47:compile
[INFO] +- com.google.protobuf:protobuf-java:jar:3.14.0:compile
[INFO] +- com.google.protobuf:protobuf-java-util:jar:3.14.0:compile
[INFO] |  +- com.google.errorprone:error_prone_annotations:jar:2.2.0:compile
[INFO] |  \- com.google.code.gson:gson:jar:2.8.6:compile
[INFO] +- io.grpc:grpc-netty-shaded:jar:1.39.0:compile
[INFO] |  \- io.perfmark:perfmark-api:jar:0.23.0:runtime
[INFO] +- io.grpc:grpc-protobuf:jar:1.39.0:compile
[INFO] |  +- io.grpc:grpc-api:jar:1.35.0:compile
[INFO] |  |  \- io.grpc:grpc-context:jar:1.35.0:compile
[INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] |  +- com.google.api.grpc:proto-google-common-protos:jar:2.0.1:compile
[INFO] |  \- io.grpc:grpc-protobuf-lite:jar:1.35.0:compile
[INFO] \- io.grpc:grpc-stub:jar:1.39.0:compile

【问题讨论】:

【参考方案1】:

要在 Quarkus 中使用 gRPC(尤其是在原生模式下),请在您的项目中添加 io.quarkus:quarkus-grpc 依赖项,而不是直接添加 gRPC 依赖项。

参见 https://github.com/quarkusio/quarkus-quickstarts/tree/main/grpc-plain-text-quickstart 和 https://github.com/quarkusio/quarkus-quickstarts/tree/main/grpc-tls-quickstart,例如使用 Quarkus 的 gRPC 项目

【讨论】:

【参考方案2】:

您需要添加依赖项 io.grpc:grpc-netty: 或 io.grpc:grpc-netty-shaded:,如错误消息中所述。

【讨论】:

在依赖树中可以看到,netty shaded 已经存在了 抱歉,没看到。我猜在本机模式下,您可能需要自己注册 META-INF/services/io.grpc.ManagedChannelProvider:quarkus.io/guides/writing-extensions#service-files

以上是关于未找到功能性渠道服务提供者。尝试添加对 grpc-okhttp、grpc-netty 或 grpc-netty-shaded 工件的依赖项的主要内容,如果未能解决你的问题,请参考以下文章

将 grpc 与 QtCreator 一起使用,未定义对 `grpc::...` 的引用

未找到服务提供者 Laravel 5.0

grpc和protobuf结合的示例

协议指定 void 参数类型时未调用 gRPC node-js 方法

grpc 使用了错误的 IP 地址

比较 gRPC 服务和 HTTP API