[ 
https://issues.apache.org/jira/browse/FLINK-19995?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17227133#comment-17227133
 ] 

zhisheng commented on FLINK-19995:
----------------------------------

I restart the SQL Client, but not the Flink Cluster, sloved now, thanks [~jark] 
[~hailong wang], i will close this issue.

> 【Flink SQL Client】Use Flink Kafka Connector in SQL-Client has more than one 
> exception
> -------------------------------------------------------------------------------------
>
>                 Key: FLINK-19995
>                 URL: https://issues.apache.org/jira/browse/FLINK-19995
>             Project: Flink
>          Issue Type: Bug
>          Components: Table SQL / Ecosystem
>    Affects Versions: 1.12.0
>            Reporter: zhisheng
>            Priority: Major
>         Attachments: image-2020-11-05-17-35-10-103.png, 
> image-2020-11-05-17-37-21-610.png, image-2020-11-05-17-40-05-630.png, 
> image-2020-11-05-17-41-01-319.png, image-2020-11-05-17-57-38-381.png
>
>
> when i add flink-sql-connector-kafka_2.11-1.12-SNAPSHOT.jar in lib, I run  
> sql job has an exception like picture2
>  
> !image-2020-11-05-17-35-10-103.png|width=658,height=251!
> !image-2020-11-05-17-37-21-610.png|width=648,height=479!
> {code:java}
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.ClassNotFoundException: 
> org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer
> {code}
> when i add flink-connector-kafka_2.11-1.12-SNAPSHOT.jar in lib, it run has 
> another exception
>  
> !image-2020-11-05-17-41-01-319.png|width=629,height=238!
> !image-2020-11-05-17-40-05-630.png|width=658,height=400!
> {code:java}
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.ClassNotFoundException: 
> org.apache.kafka.common.serialization.ByteArrayDeserializer
> {code}
> if i add both jar, it returm exception too
> {code:java}
> [ERROR] Could not execute SQL statement. Reason:
> java.lang.ClassNotFoundException: 
> org.apache.kafka.common.serialization.ByteArrayDeserializer
> {code}
> ddl & sql:
>  
> {code:java}
> CREATE TABLE UserBehavior (
>  user_id BIGINT,
>  item_id BIGINT,
>  behavior CHAR(2),
>  `time` BIGINT
> ) WITH (
>  'connector' = 'kafka',
>  'topic' = 'user_behavior',
>  'properties.bootstrap.servers' = 'localhost:9092',
>  'properties.group.id' = 'user_behavior_flink',
>  'format' = 'json',
>  'json.ignore-parse-errors' = 'true',  
>  'scan.startup.mode' = 'earliest-offset',
>  'scan.topic-partition-discovery.interval' = '10000'
> );
> select * from UserBehavior;{code}
>  
> i found same problem at 
> [http://apache-flink.147419.n8.nabble.com/sql-cli-sql-td7530.html]
>  
> i see there are two dependencies conflicts
>  
> !image-2020-11-05-17-57-38-381.png|width=1328,height=711!
> i try to solve the conflict, but it doesn't work
>  
> {code:java}
> ➜  flink-1.12-SNAPSHOT jar -tf 
> ./lib/flink-sql-connector-kafka_2.11-1.12-SNAPSHOT.jar |grep 'ConsumerRecord'
> org/apache/flink/kafka/shaded/org/apache/kafka/clients/consumer/ConsumerRecords$ConcatenatedIterable$1.class
> org/apache/flink/kafka/shaded/org/apache/kafka/clients/consumer/ConsumerRecord.class
> org/apache/flink/kafka/shaded/org/apache/kafka/clients/consumer/ConsumerRecords$ConcatenatedIterable.class
> org/apache/flink/kafka/shaded/org/apache/kafka/clients/consumer/ConsumerRecords.class
> ➜  flink-1.12-SNAPSHOT jar -tf 
> ./lib/flink-sql-connector-kafka_2.11-1.12-SNAPSHOT.jar |grep 
> 'FlinkKafkaConsumer'
> org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumer.class
> org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase$1.class
> org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase.class
> org/apache/flink/streaming/connectors/kafka/FlinkKafkaConsumerBase$2.class
> ➜  flink-1.12-SNAPSHOT jar -tf 
> ./lib/flink-sql-connector-kafka_2.11-1.12-SNAPSHOT.jar |grep 
> 'ByteArrayDeserializer'
> org/apache/flink/kafka/shaded/org/apache/kafka/common/serialization/ByteArrayDeserializer.class
> ➜  flink-1.12-SNAPSHOT jar -tf 
> ./lib/flink-sql-connector-kafka_2.11-1.12-SNAPSHOT.jar |grep 
> 'FlinkKafkaConsumer'
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to