Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

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


+
Ashish Nigam 2013-06-06, 22:26
Copy link to this message
-
Re: java.lang.NumberFormatException: null - when producer tries to send message to Kafka queue
Jun Rao 2013-06-07, 05:26
Which version of ZK are you using?

Thanks,

Jun
On Thu, Jun 6, 2013 at 3:26 PM, Ashish Nigam <[EMAIL PROTECTED]> 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)
>
> at kafka.javaapi.producer.Producer.<init>(Producer.scala:33)
>
> at kafka.javaapi.producer.Producer.<init>(Producer.scala:40)
>
> at
>
> com.shn.analytics.shneventprocessor.KafkaTestClient.test(KafkaTestClient.java:86)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)

 
+
Andrea Gazzarini 2013-06-07, 15:19