You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-zh@flink.apache.org by RS <ti...@163.com> on 2020/07/27 13:57:27 UTC

kafka avro格式sink报错,NoClassDefFoundError: Could not initialize class org.apache.avro.SchemaBuilder

Hi,
版本:Flink-1.11.1
任务启动模式:standalone
Flink任务编译的jar的maven中包含了flink-avro,jar-with-dependencies编译的
        <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-avro</artifactId>
            <version>1.11.1</version>
        </dependency>
编译出来的jar也包含了这个class


我看官网上说明 Flink has extensive built-in support for Apache Avro。感觉默认是支持avro的
1. 直接启动的话,会报错  Caused by: org.apache.flink.table.api.ValidationException: Could not find any factory for identifier 'avro' that implements 'org.apache.flink.table.factories.SerializationFormatFactory' in the classpath.
Available factory identifiers are:
canal-json
csv
debezium-json
json
2. 下载了一个flink-avro-1.11.1.jar的jar包扔到了flink/lib下,报错 Caused by: java.lang.ClassNotFoundException: org.apache.avro.generic.GenericRecord
3. 下载了avro-1.10.0.jar放到flink/lib下,报错 Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.apache.avro.SchemaBuilder
请教下,要支持avro的话,还需要怎么操作下?


Thanks