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

ASF GitHub Bot commented on KAFKA-4883:
---------------------------------------

omkreddy opened a new pull request #4849: KAFKA-4883: handle 
NullPointerException while parsing login modue control flag
URL: https://github.com/apache/kafka/pull/4849
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> invalid client sasl.jaas.config triggers NullPointerException
> -------------------------------------------------------------
>
>                 Key: KAFKA-4883
>                 URL: https://issues.apache.org/jira/browse/KAFKA-4883
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.10.2.0
>            Reporter: Xavier Léauté
>            Priority: Minor
>
> Using an invalid sasl.jaas.config property causes a NullPointerException to 
> be thrown, which makes it difficult to understand the root of the problem.
> Example of an invalid config
> {code}
> sasl.jaas.config=KafkaClient {\n\
>   org.apache.kafka.common.security.plain.PlainLoginModule required\n\
>   username="xxxxx"\n\
>   password="XXXX";\n\
> }
> {code}
> Resulting stack trace:
> {code}
> org.apache.kafka.common.KafkaException: Failed to construct kafka producer
>       at 
> org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:342)
>       at 
> org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:166)
> [...]
> Caused by: org.apache.kafka.common.KafkaException: 
> java.lang.NullPointerException
>       at 
> org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:94)
>       at 
> org.apache.kafka.common.network.ChannelBuilders.create(ChannelBuilders.java:93)
>       at 
> org.apache.kafka.common.network.ChannelBuilders.clientChannelBuilder(ChannelBuilders.java:51)
>       at 
> org.apache.kafka.clients.ClientUtils.createChannelBuilder(ClientUtils.java:84)
>       at 
> org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:305)
>       ... 41 more
> Caused by: java.lang.NullPointerException
>       at 
> org.apache.kafka.common.security.JaasConfig.loginModuleControlFlag(JaasConfig.java:87)
>       at 
> org.apache.kafka.common.security.JaasConfig.parseAppConfigurationEntry(JaasConfig.java:110)
>       at 
> org.apache.kafka.common.security.JaasConfig.<init>(JaasConfig.java:65)
>       at 
> org.apache.kafka.common.security.JaasUtils.jaasConfig(JaasUtils.java:59)
>       at 
> org.apache.kafka.common.network.SaslChannelBuilder.configure(SaslChannelBuilder.java:85)
>       ... 45 more
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to