google-cloud-firestore - FirestoreException - 找不到 TLS ALPN 提供程序 - 没有工作 netty-tcnative

标签 google-cloud-firestore netty alpn

我有一个用 Java/Kotlin 制作的桌面应用,具有 Firebase(特别是 Firestore 实时)连接。

它在我的笔记本电脑(通过 Parallels 的 Windows)和其他经过 Windows 测试的笔记本电脑上运行正常。但是,在某些电脑上我总是遇到错误:

com.google.cloud.firestore.FirestoreException:java.lang.IllegalStateException:找不到 TLS ALPN 提供程序;没有可用的 netty tcnative、Conscrypt 或 Jetty NPN/ALPN

我尝试了一些 jar 的创建变体,但没有任何帮助。

这是我当前的 build.gradle 连接:

plugins {
    id 'java'
    id 'org.jetbrains.kotlin.jvm' version '1.3.21'
}

jar {
    manifest {
        attributes 'Main-Class': 'main.LoginActivity'
    }
}

// java -cp Y:\Desktop\nwebprint\out\artifacts\nwebprint_main_jar\nwebprint.main.jar main.LoginActivity

group 'nwebprint'
version '1.0-SNAPSHOT'

sourceCompatibility = 1.8

repositories {
    mavenCentral()
}

version = '1.0'
sourceCompatibility = 1.7
targetCompatibility = 1.7

//create a single Jar with all dependencies
task fatJar(type: Jar) {
    manifest {
        attributes 'Implementation-Title': 'Notary Web Service',
                'Implementation-Version': version,
                'Main-Class': 'main.LoginActivity'
    }
    baseName = project.name + '-all'
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
    testCompile group: 'junit', name: 'junit', version: '4.12'

    compile ('com.google.firebase:firebase-admin:6.8.0') {
        exclude( group: 'com.google.guava')
    }

    compile 'com.google.guava:guava:20.0'

    // compile 'io.grpc:grpc-netty-shaded'
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

最佳答案

Docker 容器中启动 FireBase 应用程序时,我遇到了同样的问题。

就我而言,我必须更改基本镜像 - 从 openjdk:8-jdk-alpineopenjdk:8

来源:https://gitmemory.com/issue/grpc/grpc-java/5369/493463266

关于google-cloud-firestore - FirestoreException - 找不到 TLS ALPN 提供程序 - 没有工作 netty-tcnative,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55578967/

相关文章:

javascript - 将 firebase 数据推送到数组 + js + vuejs 中

firebase - 如果仅知道一个字段(firestore)的数据,如何查找文档的id?

java - 使用 Apple (Netty) 的 ServiceTalk 作为 RESTful API 与 Jersey 和 Let's Encrypt HTTPS

java - 在主 Jar 中引用 Jar 以作为 javaagent 传递到 JVM

upgrade - Ubuntu 18.04 中的 HTTP/2

java - Firestore 服务器时间 unix java

javascript - 根据 URL 中的参数调用 Firebase 中的特定字段时遇到问题

java - 网络性能缓慢

java - 在 netty TCP 连接上存储变量

java - 如何使用 ALPN 在 Jetty SPDY 上使用客户端证书?