From jira-return-11455-archive-asf-public=cust-asf.ponee.io@kafka.apache.org Tue Apr 3 11:36:04 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 1CF7118064D for ; Tue, 3 Apr 2018 11:36:03 +0200 (CEST) Received: (qmail 31294 invoked by uid 500); 3 Apr 2018 09:36:03 -0000 Mailing-List: contact jira-help@kafka.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@kafka.apache.org Delivered-To: mailing list jira@kafka.apache.org Received: (qmail 31279 invoked by uid 99); 3 Apr 2018 09:36:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2018 09:36:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id A64C71A081C for ; Tue, 3 Apr 2018 09:36:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -101.511 X-Spam-Level: X-Spam-Status: No, score=-101.511 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id X641ZIi_CvRV for ; Tue, 3 Apr 2018 09:36:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 759C05F1F0 for ; Tue, 3 Apr 2018 09:36:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E4568E0D6A for ; Tue, 3 Apr 2018 09:36:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 3ECF425616 for ; Tue, 3 Apr 2018 09:36:00 +0000 (UTC) Date: Tue, 3 Apr 2018 09:36:00 +0000 (UTC) From: "Philippe Hong (JIRA)" To: jira@kafka.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (KAFKA-6728) Kafka Connect Header Null Pointer Exception MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KAFKA-6728?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1642= 3740#comment-16423740 ]=20 Philippe Hong edited comment on KAFKA-6728 at 4/3/18 9:35 AM: -------------------------------------------------------------- Thank you, adding {}header.converter=3Dorg.apache.kafka.connect.storage.Sim= p leHeaderConverter{} solved my issue as you mentioned. Good job on impleme= nting a more convenient and lasting fix. was (Author: hwki): Thank you, adding header.converter=3Dorg.apache.kafka.connect.storage.SimpleHeaderConverter solved my issue as you mentioned. Good job on implementing a more convenien= t and lasting fix. > Kafka Connect Header Null Pointer Exception > ------------------------------------------- > > Key: KAFKA-6728 > URL: https://issues.apache.org/jira/browse/KAFKA-6728 > Project: Kafka > Issue Type: Bug > Components: KafkaConnect > Affects Versions: 1.1.0 > Environment: Linux Mint > Reporter: Philippe Hong > Priority: Critical > > I am trying to use the newly released Kafka Connect that supports headers= by using the standalone connector to write to a text file (so in this case= I am only using the sink component) > I am sadly greeted by a NullPointerException : > {noformat} > ERROR WorkerSinkTask{id=3Dlocal-file-sink-0} Task threw an uncaught and u= nrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:172) > java.lang.NullPointerException > =C2=A0=C2=A0 =C2=A0at org.apache.kafka.connect.runtime.WorkerSinkTask.con= vertHeadersFor(WorkerSinkTask.java:501) > =C2=A0=C2=A0 =C2=A0at org.apache.kafka.connect.runtime.WorkerSinkTask.con= vertMessages(WorkerSinkTask.java:469) > =C2=A0=C2=A0 =C2=A0at org.apache.kafka.connect.runtime.WorkerSinkTask.pol= l(WorkerSinkTask.java:301) > =C2=A0=C2=A0 =C2=A0at org.apache.kafka.connect.runtime.WorkerSinkTask.ite= ration(WorkerSinkTask.java:205) > =C2=A0=C2=A0 =C2=A0at org.apache.kafka.connect.runtime.WorkerSinkTask.exe= cute(WorkerSinkTask.java:173) > =C2=A0=C2=A0 =C2=A0at org.apache.kafka.connect.runtime.WorkerTask.doRun(W= orkerTask.java:170) > =C2=A0=C2=A0 =C2=A0at org.apache.kafka.connect.runtime.WorkerTask.run(Wor= kerTask.java:214) > =C2=A0=C2=A0 =C2=A0at java.util.concurrent.Executors$RunnableAdapter.call= (Executors.java:511) > =C2=A0=C2=A0 =C2=A0at java.util.concurrent.FutureTask.run(FutureTask.java= :266) > =C2=A0=C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor.runWorker(T= hreadPoolExecutor.java:1149) > =C2=A0=C2=A0 =C2=A0at java.util.concurrent.ThreadPoolExecutor$Worker.run(= ThreadPoolExecutor.java:624) > =C2=A0=C2=A0 =C2=A0at java.lang.Thread.run(Thread.java:748) > {noformat} > I launched zookeeper and kafka 1.1.0 locally and sent a ProducerRecord[St= ring, Array[Byte]] using a KafkaProducer[String, Array[Byte]] with a header= that has a key and value. > I can read the record with a console consumer as well as using a KafkaCon= sumer (where in this case I can see the content of the header of the record= I sent previously) so no problem here. > I only made two changes to the kafka configuration: > =C2=A0=C2=A0=C2=A0 - I used the StringConverter for the key and the Byte= ArrayConverter for the value.=20 > =C2=A0=C2=A0=C2=A0 - I also changed the topic where the sink would conne= ct to. > If I forgot something please tell me so as it is the first time I am crea= ting an issue on Jira. -- This message was sent by Atlassian JIRA (v7.6.3#76005)