Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Kafka >> mail # user >> java.lang.NumberFormatException: null - when producer tries to send message to Kafka queue


Copy link to this message
-
Re: java.lang.NumberFormatException: null - when producer tries to send message to Kafka queue
Hi,
looking at the stack trace It seems to me you are using Kafka 0.7.0.
Well, I think the issue has something to do with broker(s) registration
(i.e Zookeeper) so you should check the startup messages on Kafka and
eventually the Zookeeper logs, I'm quite sure you will find something there.

The null value

/java.lang.NumberFormatException: null/

//that causes the NumberFormatException should be the number of topic
partitions that a given broker owns.  So it seems that you Zookeeper has
a node like this

//brokers/topics/<topic name>/<broker id> //
/
which doesn't have any data (i.e. number of partitions) associated.

Cheers,
Andrea

On 06/07/2013 12:26 AM, Ashish Nigam wrote:
> Hi,
> I am getting exception when Producer tries to send messages to Kafka queue.
>
> It tries to connect to zookeeper instances and then throws exception.
> Here's initial log -
>
> 06 Jun 2013 15:17:29,541 [DEBUG] ZkConnection             | Creating new
> ZookKeeper instance to connect to 172.16.1.104:2181
>
> 06 Jun 2013 15:17:29,541 [INFO ] ZkEventThread            | Starting
> ZkClient event thread.
>
> 06 Jun 2013 15:17:31,610 [DEBUG] ZkClient                 | Awaiting
> connection to Zookeeper server
>
> 06 Jun 2013 15:17:31,611 [DEBUG] ZkClient                 | Waiting for
> keeper state SyncConnected
>
> 06 Jun 2013 15:17:32,787 [DEBUG] ZkClient                 | Received event:
> WatchedEvent state:SyncConnected type:None path:null
>
> 06 Jun 2013 15:17:32,787 [INFO ] ZkClient                 | zookeeper state
> changed (SyncConnected)
>
> 06 Jun 2013 15:17:32,787 [DEBUG] ZkClient                 | Leaving process
> event
>
> 06 Jun 2013 15:17:32,787 [DEBUG] ZkClient                 | State is
> SyncConnected
>
>
> After this it throws NumberFormat exception -
>
>
> java.lang.NumberFormatException: null
>
> at java.lang.Integer.parseInt(Integer.java:417)
>
> at java.lang.Integer.parseInt(Integer.java:499)
>
> at scala.collection.immutable.StringLike$class.toInt(StringLike.scala:231)
>
> at scala.collection.immutable.StringOps.toInt(StringOps.scala:31)
>
> at
> kafka.producer.ZKBrokerPartitionInfo$$anonfun$kafka$producer$ZKBrokerPartitionInfo$$getZKTopicPartitionInfo$1$$anonfun$5.apply(ZKBrokerPartitionInfo.scala:171)
>
> at
> kafka.producer.ZKBrokerPartitionInfo$$anonfun$kafka$producer$ZKBrokerPartitionInfo$$getZKTopicPartitionInfo$1$$anonfun$5.apply(ZKBrokerPartitionInfo.scala:171)
>
> at
> scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
>
> at
> scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:194)
>
> at scala.collection.Iterator$class.foreach(Iterator.scala:660)
>
> at
> scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:573)
>
> at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
>
> at
> scala.collection.JavaConversions$JListWrapper.foreach(JavaConversions.scala:615)
>
> at scala.collection.TraversableLike$class.map(TraversableLike.scala:194)
>
> at
> scala.collection.JavaConversions$JListWrapper.map(JavaConversions.scala:615)
>
> at
> kafka.producer.ZKBrokerPartitionInfo$$anonfun$kafka$producer$ZKBrokerPartitionInfo$$getZKTopicPartitionInfo$1.apply(ZKBrokerPartitionInfo.scala:171)
>
> at
> kafka.producer.ZKBrokerPartitionInfo$$anonfun$kafka$producer$ZKBrokerPartitionInfo$$getZKTopicPartitionInfo$1.apply(ZKBrokerPartitionInfo.scala:167)
>
> at scala.collection.Iterator$class.foreach(Iterator.scala:660)
>
> at
> scala.collection.JavaConversions$JIteratorWrapper.foreach(JavaConversions.scala:573)
>
> at scala.collection.IterableLike$class.foreach(IterableLike.scala:73)
>
> at
> scala.collection.JavaConversions$JListWrapper.foreach(JavaConversions.scala:615)
>
> at
> kafka.producer.ZKBrokerPartitionInfo.kafka$producer$ZKBrokerPartitionInfo$$getZKTopicPartitionInfo(ZKBrokerPartitionInfo.scala:167)
>
> at
> kafka.producer.ZKBrokerPartitionInfo.<init>(ZKBrokerPartitionInfo.scala:66)
>
> at kafka.producer.Producer.<init>(Producer.scala:53)
 
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB