首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >从云数据流连接到bigtable

从云数据流连接到bigtable
EN

Stack Overflow用户
提问于 2018-07-07 02:09:25
回答 2查看 259关注 0票数 0

我正在尝试从beam api连接到BigTable。我经常会遇到一个错误:

代码语言:javascript
运行
复制
Exception in thread "BigtableSession-startup-1" 
java.lang.IllegalArgumentException: Jetty ALPN/NPN has not been 
properly configured.

下面是我使用的POM:">http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

代码语言:javascript
运行
复制
<groupId>com.dataflow.example</groupId>
<artifactId>dataflowTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>

<name>dataflowTest</name>
<url>http://maven.apache.org</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven-compiler-plugin.version>3.6.2</maven-compiler-plugin.version>
    <maven-exec-plugin.version>1.6.0</maven-exec-plugin.version>
    <beam.version>2.1.0</beam.version>
    <bigtable.version>1.0.0</bigtable.version>
    <slf4j.version>1.7.21</slf4j.version>
    <bigtable.table>Dataflow_test</bigtable.table>
    <pubsubTopic>projects/${bigtable.projectID}/topics/shakes</pubsubTopic>
    <bigtable.hbase.version>${bigtable.version}</bigtable.hbase.version>
</properties>

<build>
    <pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.5.1</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
    <extensions>
        <!-- Use os-maven-plugin to initialize the "os.detected" properties -->
        <extension>
            <groupId>kr.motd.maven</groupId>
            <artifactId>os-maven-plugin</artifactId>
            <version>1.4.0.Final</version>
        </extension>
    </extensions>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <executions>
                <execution>
                    <id>bundle-and-repackage</id>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <filters>
                            <filter>
                                <artifact>*:*</artifact>
                                <excludes>
                                    <exclude>META-INF/*.SF</exclude>
                                    <exclude>META-INF/*.DSA</exclude>
                                    <exclude>META-INF/*.RSA</exclude>
                                </excludes>
                            </filter>
                        </filters>
                        <transformers>
                            <transformer
                                implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
                        </transformers>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>


<dependencies>
    <dependency>
        <groupId>org.apache.beam</groupId>
        <artifactId>beam-runners-google-cloud-dataflow-java</artifactId>
        <version>2.2.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.beam</groupId>
        <artifactId>beam-sdks-java-extensions-google-cloud-platform-core</artifactId>
        <version>2.2.0</version>
        <exclusions>
            <exclusion>
                <groupId>io.netty</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.mortbay.jetty.alpn/alpn-boot -->
    <!-- https://mvnrepository.com/artifact/io.netty/netty-tcnative-boringssl-static -->
    <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-tcnative-boringssl-static</artifactId>
        <version>2.0.7.Final</version>
    </dependency>

    <dependency>
        <groupId>com.google.cloud.bigtable</groupId>
        <artifactId>bigtable-hbase-beam</artifactId>
        <version>${bigtable.version}</version>
        <exclusions>
            <exclusion>
                <groupId>io.netty</groupId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>com.google.cloud.dataflow</groupId>
        <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
        <version>2.2.0</version>
        <exclusions>
            <exclusion>
                <groupId>io.netty</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>6.0.6</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>

和我得到这个错误的代码库:

代码语言:javascript
运行
复制
try (BigtableSession session = new BigtableSession(optionsBuilder
        .setCredentialOptions(CredentialOptions.credential(options.as(GcpOptions.class).getGcpCredential())).build())) {

      BigtableTableAdminClient tableAdminClient = session.getTableAdminClient();

我试过fork26,fork13,2.0.7,fork26和各种其他版本的netty。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51215761

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档