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

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

edoardocomar commented on pull request #6524: KAFKA-8162: IBM JDK Class not 
found error when handling SASL
URL: https://github.com/apache/kafka/pull/6524
 
 
   Attempt to load the IBM internal class but fallback on loading the Sun
   class if the IBM one is not found.
   
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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


> IBM JDK Class not found error when handling SASL authentication exception
> -------------------------------------------------------------------------
>
>                 Key: KAFKA-8162
>                 URL: https://issues.apache.org/jira/browse/KAFKA-8162
>             Project: Kafka
>          Issue Type: Bug
>          Components: clients, core
>    Affects Versions: 2.1.0, 2.2.0, 2.1.1
>         Environment: Any with IBM JDK 8 SR5 FP10
>            Reporter: Arkadiusz Firus
>            Assignee: Edoardo Comar
>            Priority: Major
>
> When there is a problem with SASL authentication then enum KerberosError is 
> being used to retrieve the error code. When IBM JDK is being used it tries to 
> load a class com.ibm.security.krb5.internal.KrbException which is not present 
> in all IBM JDK versions. This leads to NoClassDefFoundError which is not 
> handled.
> I tested it on:
>  java version "1.8.0_161"
>  Java(TM) SE Runtime Environment (build 8.0.5.10 - 
> pxa6480sr5fp10-20180214_01(SR5 FP10))
>  IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64 Compressed References 
> 20180208_378436 (JIT enabled, AOT enabled)
> In this version of JDK class KrbException is in package com.ibm.security.krb5 
> (without internal). So the fully class name is: 
> com.ibm.security.krb5.KrbException
> Full stack trace from the logs:
> [2019-03-27 06:50:00,113] ERROR Processor got uncaught exception. 
> (kafka.network.Processor)
> java.lang.NoClassDefFoundError: 
> org.apache.kafka.common.security.kerberos.KerberosError (initialization 
> failure)
>         at 
> java.lang.J9VMInternals.initializationAlreadyFailed(J9VMInternals.java:96)
>         at 
> org.apache.kafka.common.security.authenticator.SaslServerAuthenticator.handleSaslToken(SaslServerAuthenticator.java:384)
>         at 
> org.apache.kafka.common.security.authenticator.SaslServerAuthenticator.authenticate(SaslServerAuthenticator.java:256)
>         at 
> org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:132)
>         at 
> org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:532)
>         at org.apache.kafka.common.network.Selector.poll(Selector.java:467)
>         at kafka.network.Processor.poll(SocketServer.scala:689)
>         at kafka.network.Processor.run(SocketServer.scala:594)
>         at java.lang.Thread.run(Thread.java:811)
> Caused by: org.apache.kafka.common.KafkaException: Kerberos exceptions could 
> not be initialized
>         at 
> org.apache.kafka.common.security.kerberos.KerberosError.<clinit>(KerberosError.java:59)
>         ... 8 more
> Caused by: java.lang.ClassNotFoundException: 
> com.ibm.security.krb5.internal.KrbException
>         at java.lang.Class.forNameImpl(Native Method)
>         at java.lang.Class.forName(Class.java:297)
>         at 
> org.apache.kafka.common.security.kerberos.KerberosError.<clinit>(KerberosError.java:53)
>         ... 8 more



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

Reply via email to