You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "Ismael Juma (JIRA)" <ji...@apache.org> on 2017/12/07 08:43:00 UTC

[jira] [Resolved] (KAFKA-6313) Kafka Core should have explicit SLF4J API dependency

     [ https://issues.apache.org/jira/browse/KAFKA-6313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ismael Juma resolved KAFKA-6313.
--------------------------------
    Resolution: Fixed

> Kafka Core should have explicit SLF4J API dependency
> ----------------------------------------------------
>
>                 Key: KAFKA-6313
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6313
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.1.0
>            Reporter: Randall Hauch
>            Assignee: Randall Hauch
>             Fix For: 1.1.0
>
>
> In an application that depends on the Kafka server artifacts with:
> {code:xml}
> 	<dependency>
> 		<groupId>org.apache.kafka</groupId>
> 		<artifactId>kafka_2.11</artifactId>
> 		<version>1.1.0-SNAPSHOT</version>
> 	</dependency>
> {code}
> and then running the server programmatically, the following error occurs:
> {noformat}
> [2017-11-23 01:01:45,029] INFO Shutting down producer (kafka.producer.Producer:63)
> [2017-11-23 01:01:45,051] INFO Closing all sync producers (kafka.producer.ProducerPool:63)
> [2017-11-23 01:01:45,052] INFO Producer shutdown completed in 23 ms (kafka.producer.Producer:63)
> [2017-11-23 01:01:45,052] INFO [KafkaServer id=1] shutting down (kafka.server.KafkaServer:63)
> [2017-11-23 01:01:45,057] ERROR [KafkaServer id=1] Fatal error during KafkaServer shutdown. (kafka.server.KafkaServer:161)
> java.lang.NoClassDefFoundError: org/slf4j/event/Level
> 	at kafka.utils.CoreUtils$.swallow$default$3(CoreUtils.scala:83)
> 	at kafka.server.KafkaServer.shutdown(KafkaServer.scala:520)
>        ...
> Caused by: java.lang.ClassNotFoundException: org.slf4j.event.Level
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
> 	at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
> 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
> 	... 25 more
> {noformat}
> It appears that KAFKA-1044 and [this PR|https://github.com/apache/kafka/pull/3477] removed the use of Log4J from Core but [added use of|https://github.com/confluentinc/kafka/commit/ed8b0315a6c3705b2a163ce3ab4723234779264f#diff-52505b9374ea885e44bcb73cbc4714d6R34] the {{org.slf4j.event.Level}} in {{CoreUtils.scala}}. The {{org.slf4j.event.Level}} class is in the {{org.slf4j:slf4j-api}} artifact, which is currently not included in the dependencies of {{org.apache.kafka:kafka_2.11:1.1.0-SNAPSHOT}}. Because this is needed by the server, the SLF4J API library probably needs to be added to the dependencies.
> [~viktorsomogyi] and [~ijuma], was this intentional, or is it intended that the SLF4J API be marked as {{provided}}? BTW, I marked this as CRITICAL just because this probably needs to be sorted out before the release.
> *Update*: As the comments below explain, the actual problem is a bit different to what is in the JIRA description.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)