flink-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stephan Ewen <se...@apache.org>
Subject Re: Kafka Test Error
Date Wed, 30 Mar 2016 14:35:27 GMT
Hi!

A "NoSuchMethodError" usually means that you compile and run against
different versions.

Make sure the version you reference in the IDE and the version on the
cluster are the same.

Greetings,
Stephan



On Wed, Mar 30, 2016 at 9:42 AM, Balaji Rajagopalan <
balaji.rajagopalan@olacabs.com> wrote:

> I have tested kafka 0.8.0.2 with flink 1.0.0 and it works for me. Can't
> talk about kafka 0.9.0.1.
>
> On Wed, Mar 30, 2016 at 12:51 PM, Zhun Shen <shenzhunallen@gmail.com>
> wrote:
>
>> Hi there,
>>
>> flink version: 1.0.0
>> kafka version: 0.9.0.0
>> env: local
>>
>> I run the script below:
>> ./bin/flink run -c com.test.flink.FlinkTest test.jar --topic nginx-logs
>> --bootstrap.servers localhost:9092 --zookeeper.connect localhost:2181 --
>> group.id myGroup --partition.assignment.strategy round robin
>>
>> But I got the error:
>> ava.lang.NoSuchMethodError:
>> org.apache.kafka.clients.consumer.KafkaConsumer.partitionsFor(Ljava/lang/String;)Ljava/util/List;
>>         at
>> org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09.<init>(FlinkKafkaConsumer09.java:194)
>>         at
>> org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09.<init>(FlinkKafkaConsumer09.java:164)
>>         at
>> org.apache.flink.streaming.connectors.kafka.FlinkKafkaConsumer09.<init>(FlinkKafkaConsumer09.java:131)
>>
>>
>> The code as  below:
>>         DataStream<String> messageStream = env.addSource(new
>> FlinkKafkaConsumer09<>("nginx-logs", new
>> SimpleStringSchema(),parameterTool.getProperties()));
>>         messageStream.rebalance().map(new MapFunction<String, String>() {
>>
>>             @Override
>>             public String map(String value) throws Exception {
>>                 return "Kafka and Flink says: " + value;
>>             }
>>         }).print();
>>
>>
>> I check the error with google, but it shows that it is a method of kafka
>> 0.9.01. Any idea? Thanks.
>>
>>
>

Mime
View raw message