Skip to main content
deleted 4720 characters in body
Source Link
Sthita
  • 1.8k
  • 3
  • 19
  • 43
11:35:07.133 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunnerTests constructorrun: called1, withFailures: [class0, hello.SpringKafkaSenderTest] 11:35Errors:07.140 [main]1, DEBUGSkipped: org.springframework.test.context.BootstrapUtils0, -Time Instantiatingelapsed: CacheAwareContextLoaderDelegate0.371 fromsec class<<< [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]FAILURE! 11:35:07hello.149 [main]SpringKafkaSenderTest DEBUG org.springframework.test.context.BootstrapUtils -Time Instantiatingelapsed: BootstrapContext0.37 usingsec constructor [public<<< org.springframework.test.context.support.DefaultBootstrapContext(ERROR! java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)] 11:35NoClassDefFoundError:07.169 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for /apache/kafka/test/TestUtils  class [hello.SpringKafkaSenderTest] from classat [org.springframeworkkafka.bootutils.testTestUtils$.context<init>(TestUtils.SpringBootTestContextBootstrapper] 11:35scala:07.18470)  [main] INFO org.springframework.boot at kafka.testutils.contextTestUtils$.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [hello<clinit>(TestUtils.SpringKafkaSenderTest],scala)  using SpringBootContextLoader 11:35:07.190 [main] DEBUGat org.springframework.testkafka.contextzk.supportEmbeddedZookeeper.AbstractContextLoader - Did not detect default resource location for test class [hello<init>(EmbeddedZookeeper.SpringKafkaSenderTest]scala: class path resource29)  [hello/SpringKafkaSenderTest-context.xml] does not exist 11:35:07.190 [main] DEBUGat org.springframework.kafka.test.contextrule.supportKafkaEmbedded.AbstractContextLoader - Did not detect default resource location for test class [hellostartZookeeper(KafkaEmbedded.SpringKafkaSenderTest]java: class path resource [hello/SpringKafkaSenderTestContext.groovy] does333)  not exist 11:35:07.190 [main] INFOat org.springframework.kafka.test.contextrule.supportKafkaEmbedded.AbstractContextLoader - Could not detect default resource locations for test class [hellobefore(KafkaEmbedded.SpringKafkaSenderTest]java:175)  no resource found for suffixes {-context.xml, Context.groovy}. 11:35:07.233 [main] DEBUGat org.springframeworkjunit.testrules.contextExternalResource$1.supportevaluate(ExternalResource.ActiveProfilesUtils - Could not find an 'annotation declaringjava:46)  class' for annotation typeat [orgorg.springframeworkjunit.testrules.contextRunRules.ActiveProfiles] and class [helloevaluate(RunRules.SpringKafkaSenderTest] 11:35java:07.23620)  [main] DEBUG  at org.springframework.bootjunit.testrunners.contextParentRunner.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [hellorun(ParentRunner.SpringKafkaSenderTest]java:363)  using defaults. 11:35:07.242 [main] INFOat org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.testjunit4.mockSpringJUnit4ClassRunner.mockitorun(SpringJUnit4ClassRunner.MockitoTestExecutionListener,java:191)  org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener,at org.springframeworkapache.bootmaven.testsurefire.autoconfigurejunit4.webJUnit4Provider.servletexecute(JUnit4Provider.WebDriverTestExecutionListener,java:252)  org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener,at org.springframework.test.context.transactionapache.TransactionalTestExecutionListener, orgmaven.springframeworksurefire.testjunit4.contextJUnit4Provider.jdbcexecuteTestSet(JUnit4Provider.SqlScriptsTestExecutionListener] 11:35java:07.256141)  [main] DEBUG  at org.springframeworkapache.bootmaven.testsurefire.contextjunit4.SpringBootTestContextBootstrapperJUnit4Provider.invoke(JUnit4Provider.java:112)  - Could not instantiate TestExecutionListenerat [org.springframework.test.contextsun.webreflect.ServletTestExecutionListener]NativeMethodAccessorImpl. Specify custom listener classes or make the default listener classes invoke0(and their requiredNative dependenciesMethod) available.   Offending class: [javax/servlet/ServletContext] 11:35:07.265 [main] INFOat org.springframeworksun.bootreflect.testNativeMethodAccessorImpl.contextinvoke(NativeMethodAccessorImpl.SpringBootTestContextBootstrapperjava:62)  - Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3dd4520b,at org.springframeworksun.bootreflect.testDelegatingMethodAccessorImpl.autoconfigureinvoke(DelegatingMethodAccessorImpl.SpringBootDependencyInjectionTestExecutionListener@5ae63ade,java:43)  org.springframework.test.context.support.DirtiesContextTestExecutionListener@610694f1, org.springframework.test.context.transaction.TransactionalTestExecutionListener@43814d18, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@5c5a1b69, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@3701eaf6,at org.springframeworkjava.bootlang.testreflect.mockMethod.mockitoinvoke(Method.ResetMocksTestExecutionListener@627551fb,java:498)  org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@2b552920, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@2758fe70, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@1f36e637, at org.springframeworkapache.bootmaven.testsurefire.autoconfigureutil.webReflectionUtils.servletinvokeMethodWithArray(ReflectionUtils.WebDriverTestExecutionListener@578486a3] 11:35java:07.266 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration189)  [null] for test classat [helloorg.SpringKafkaSenderTest] 11:35:07apache.267 [main] DEBUG orgmaven.springframeworksurefire.testbooter.annotationProviderFactory$ProviderProxy.ProfileValueUtils -invoke(ProviderFactory.java:165)  Retrieved ProfileValueSource type [classat org.springframework.test.annotation.SystemProfileValueSource] for class [helloapache.SpringKafkaSenderTest] 11:35:07maven.277 [main] DEBUG orgsurefire.springframeworkbooter.testProviderFactory.annotationinvokeProvider(ProviderFactory.ProfileValueUtils - Retrieved @ProfileValueSourceConfigurationjava:85)  [null] for test classat [helloorg.SpringKafkaSenderTest] 11:35:07apache.278 [main] DEBUG orgmaven.springframeworksurefire.testbooter.annotationForkedBooter.ProfileValueUtils -runSuitesInProcess(ForkedBooter.java:115)  Retrieved ProfileValueSource type [classat org.springframework.test.annotation.SystemProfileValueSource] for class [helloapache.SpringKafkaSenderTest] 11:35:07maven.279 [main] DEBUG orgsurefire.springframeworkbooter.testForkedBooter.annotationmain(ForkedBooter.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for testjava:75) Caused classby: [hellojava.SpringKafkaSenderTest] 11:35:07lang.279 [main] DEBUGClassNotFoundException: org.springframeworkapache.testkafka.annotationtest.ProfileValueUtilsTestUtils  - Retrieved ProfileValueSource type [classat orgjava.springframeworknet.testURLClassLoader.annotationfindClass(URLClassLoader.SystemProfileValueSource]java:381)  for class [hello.SpringKafkaSenderTest] 11:35:07.280 [main] DEBUGat orgjava.springframeworklang.testClassLoader.annotationloadClass(ClassLoader.ProfileValueUtils - Retrievedjava:424)  @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.280 [main] DEBUGat orgsun.springframeworkmisc.testLauncher$AppClassLoader.annotationloadClass(Launcher.ProfileValueUtilsjava:331)  - Retrieved ProfileValueSource type [classat org.springframeworkjava.testlang.annotationClassLoader.SystemProfileValueSource] for class [helloloadClass(ClassLoader.SpringKafkaSenderTest] 11:35java:07.295357)  [main] DEBUG org.springframework .test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null]21 formore Results test: Tests classin [hello.SpringKafkaSenderTest] 11:35error:07.295 [main]   DEBUG org.springframework.test.annotationhello.ProfileValueUtils - Retrieved ProfileValueSource type [classSpringKafkaSenderTest: org.springframework./apache/kafka/test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest]/TestUtils 
11:35:07.133 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class hello.SpringKafkaSenderTest] 11:35:07.140 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate] 11:35:07.149 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)] 11:35:07.169 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [hello.SpringKafkaSenderTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper] 11:35:07.184 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [hello.SpringKafkaSenderTest], using SpringBootContextLoader 11:35:07.190 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [hello.SpringKafkaSenderTest]: class path resource [hello/SpringKafkaSenderTest-context.xml] does not exist 11:35:07.190 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [hello.SpringKafkaSenderTest]: class path resource [hello/SpringKafkaSenderTestContext.groovy] does not exist 11:35:07.190 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [hello.SpringKafkaSenderTest]: no resource found for suffixes {-context.xml, Context.groovy}. 11:35:07.233 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [hello.SpringKafkaSenderTest] 11:35:07.236 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [hello.SpringKafkaSenderTest]: using defaults. 11:35:07.242 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] 11:35:07.256 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [javax/servlet/ServletContext] 11:35:07.265 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3dd4520b, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5ae63ade, org.springframework.test.context.support.DirtiesContextTestExecutionListener@610694f1, org.springframework.test.context.transaction.TransactionalTestExecutionListener@43814d18, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@5c5a1b69, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@3701eaf6, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@627551fb, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@2b552920, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@2758fe70, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@1f36e637, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@578486a3] 11:35:07.266 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.267 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.277 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.278 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.279 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.279 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.280 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.280 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.295 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.295 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 
 Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.371 sec <<< FAILURE! hello.SpringKafkaSenderTest Time elapsed: 0.37 sec <<< ERROR! java.lang.NoClassDefFoundError: org/apache/kafka/test/TestUtils  at kafka.utils.TestUtils$.<init>(TestUtils.scala:70)   at kafka.utils.TestUtils$.<clinit>(TestUtils.scala)  at kafka.zk.EmbeddedZookeeper.<init>(EmbeddedZookeeper.scala:29)  at org.springframework.kafka.test.rule.KafkaEmbedded.startZookeeper(KafkaEmbedded.java:333)  at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:175)  at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)  at org.junit.rules.RunRules.evaluate(RunRules.java:20)    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)  at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191)  at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)  at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  at java.lang.reflect.Method.invoke(Method.java:498)   at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)  at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)  at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)  at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)  at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) Caused by: java.lang.ClassNotFoundException: org.apache.kafka.test.TestUtils  at java.net.URLClassLoader.findClass(URLClassLoader.java:381)  at java.lang.ClassLoader.loadClass(ClassLoader.java:424)  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)  at java.lang.ClassLoader.loadClass(ClassLoader.java:357)   ... 21 more Results : Tests in error:    hello.SpringKafkaSenderTest: org/apache/kafka/test/TestUtils 
deleted 4516 characters in body
Source Link
Sthita
  • 1.8k
  • 3
  • 19
  • 43
17:55:17.285 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 28,1 replyHeader:: 28,19,0 request:: '/cluster,,v{s{31,s{'world,'anyone}}},0 response:: '/cluster 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.286 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 29,1 replyHeader:: 29,20,0 request:: '/cluster/id,#7b2276657273696f6e223a2231222c226964223a22666c515659656d615347754658465564467034436a51227d,v{s{31,s{'world,'anyone}}},0 response:: '/cluster/id 17:55:17.286 [main] INFO kafka.server.KafkaServer - Cluster ID = flQVYemaSGuFXFUdFp4CjQ 17:55:17.289 [main] WARN kafka.server.BrokerMetadataCheckpoint - No meta.properties file under dir /var/folders/_s/k06t9c8x7470lcccm39r96fc0000gp/T/kafka-1152284705018404476/meta.properties 17:55:17.307 [ThrottledRequestReaper-Fetch] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Fetch], Starting 17:55:17.308 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Fetch-delayQueue 17:55:17.309 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Produce-delayQueue 17:55:17.309 [ThrottledRequestReaper-Produce] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Produce], Starting 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.330 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 30,8 replyHeader:: 30,20,0 request:: '/brokers/topics,F response:: v{} 17:55:17.345 [main] INFO kafka.log.LogManager - Loading logs. 17:55:17.352 [main] INFO kafka.log.LogManager - Logs loading complete in 7 ms. 17:55:17.380 [main] INFO kafka.log.LogManager - Starting log cleanup with a period of 300000 ms. 17:55:17.381 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-retention with initial delay 30000 ms and period 300000 ms. 17:55:17.383 [main] INFO kafka.log.LogManager - Starting log flusher with a default period of 9223372036854775807 ms. 17:55:17.383 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-flusher with initial delay 30000 ms and period 9223372036854775807 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-recovery-point-checkpoint with initial delay 30000 ms and period 60000 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-delete-logs with initial delay 30000 ms and period 60000 ms. 17:55:17.385 [main] INFO kafka.log.LogCleaner - Starting the log cleaner 17:55:17.386 [kafka-log-cleaner-thread-0] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Starting 17:55:17.414 [main] ERROR kafka.server.KafkaServer - [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown java.lang.NoSuchMethodError: org.apache.kafka.common.network.ChannelBuilders.serverChannelBuilder(Lorg/apache/kafka/common/protocol/SecurityProtocol;Ljava/util/Map;Lorg/apache/kafka/common/security/authenticator/CredentialCache;)Lorg/apache/kafka/common/network/ChannelBuilder; at kafka.network.Processor.<init>(SocketServer.scala:422) at kafka.network.SocketServer.newProcessor(SocketServer.scala:145) at kafka.network.SocketServer$$anonfun$startup$1$$anonfun$apply$1.apply$mcVI$sp(SocketServer.scala:96) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:95) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:90) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at kafka.network.SocketServer.startup(SocketServer.scala:90) at kafka.server.KafkaServer.startup(KafkaServer.scala:215) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.415 [main] INFO kafka.server.KafkaServer - [Kafka Server 0], shutting down 17:55:17.416 [main] INFO kafka.network.SocketServer - [Socket Server on Broker 0], Shutting down 17:55:17.417 [main] WARN kafka.utils.CoreUtils$ - null java.lang.NullPointerException: null at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186) at kafka.network.SocketServer.shutdown(SocketServer.scala:129) at kafka.server.KafkaServer$$anonfun$shutdown$2.apply$mcV$sp(KafkaServer.scala:582) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:78) at kafka.utils.Logging$class.swallowWarn(Logging.scala:94) at kafka.utils.CoreUtils$.swallowWarn(CoreUtils.scala:48) at kafka.utils.Logging$class.swallow(Logging.scala:96) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:48) at kafka.server.KafkaServer.shutdown(KafkaServer.scala:582) at kafka.server.KafkaServer.startup(KafkaServer.scala:289) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.418 [main] DEBUG kafka.utils.KafkaScheduler - Shutting down task scheduler. 17:55:17.419 [main] INFO kafka.log.LogManager - Shutting down. 17:55:17.420 [main] INFO kafka.log.LogCleaner - Shutting down the log cleaner. 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutting down 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutdown completed 11:35:07.133 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class hello.SpringKafkaSenderTest] 11:35:07.140 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate] 11:35:07.149 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)] 11:35:07.169 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [hello.SpringKafkaSenderTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper] 11:35:07.184 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [hello.SpringKafkaSenderTest], using SpringBootContextLoader 11:35:07.190 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [hello.SpringKafkaSenderTest]: class path resource [hello/SpringKafkaSenderTest-context.xml] does not exist 11:35:07.190 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [hello.SpringKafkaSenderTest]: class path resource [hello/SpringKafkaSenderTestContext.groovy] does not exist 11:35:07.190 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [hello.SpringKafkaSenderTest]: no resource found for suffixes {-context.xml, Context.groovy}. 11:35:07.233 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [hello.SpringKafkaSenderTest] 11:35:07.236 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [hello.SpringKafkaSenderTest]: using defaults. 11:35:07.242 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] 11:35:07.256 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [javax/servlet/ServletContext] 11:35:07.265 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3dd4520b, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5ae63ade, org.springframework.test.context.support.DirtiesContextTestExecutionListener@610694f1, org.springframework.test.context.transaction.TransactionalTestExecutionListener@43814d18, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@5c5a1b69, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@3701eaf6, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@627551fb, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@2b552920, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@2758fe70, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@1f36e637, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@578486a3] 11:35:07.266 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.267 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.277 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.278 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.279 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.279 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.280 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.280 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.295 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.295 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 

EDIT :
AddingUpdated my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>hello</groupId> <artifactId>hello</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <spring-boot.version>1.5.410.RELEASE</spring-boot.version> <kafka.version>0.11.0.0</kafka.version> <java.version>1.8</java.version>  <jackson.version>2.8.9</jackson.version>  <maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.target>${java.version}</maven.compiler.target> <junit.version>4.12</junit.version> <commons-lang3.version>3.6</commons-lang3.version> <spring-kafka.version>1.23.2.RELEASE</spring-kafka.version> <!-- plugin versions --> <mongodb.version>3.4.2</mongodb.version> <docker.plugin.version>0.4.13</docker.plugin.version> <common.lang.version>1.1-SNAPSHOT</common.lang.version> <commons-collections4.version>4.0</commons-collections4.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> <version>${spring-kafka.version}</version> <exclusions> <exclusion> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> </exclusion> </exclusions> </dependency> <dependency>  <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>${spring-boot.version}</version> <scope>test</scope> </dependency> <dependency>  <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>${kafka.version}</version> </dependency> <dependency> <groupId>org.mongodb<springframework.kafka</groupId> <artifactId>mongodb<artifactId>spring-driver<kafka-test</artifactId> <version>${mongodbspring-kafka.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> <exclusions> <exclusion> <groupId>org.mongodb<apache.kafka</groupId> <artifactId>mongodb<artifactId>kafka-driver<clients</artifactId> </exclusion> </exclusions>  </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>${commons-lang3.version}</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>${commons-collections4.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-parameter-names</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jdk8</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> <version>${jackson.version}</version> </dependency> <!-- Test Dependencies --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId>  <scope>test</scope> </dependency>  <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka-test</artifactId> <version>${spring-kafka.version}</version> <scope>test</scope> </dependency>  <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.github<groupId>org.joelittlejohnapache.embedmongo<kafka</groupId> <artifactId>embedmongo-maven-plugin<<artifactId>kafka_2.11</artifactId> <version>0.311.4<0.0</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> </archive>  </configuration> </plugin> <plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> <version>2.2.2</version> <executions> <execution> <goals> <goal>revision</goal> </goals> </execution> </executions> <configuration> <generateGitPropertiesFile>true</generateGitPropertiesFile> <generateGitPropertiesFilename>${project.build.directory}/git.properties</generateGitPropertiesFilename>  </configuration> </plugin>    </plugins> </build> </project>  
17:55:17.285 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 28,1 replyHeader:: 28,19,0 request:: '/cluster,,v{s{31,s{'world,'anyone}}},0 response:: '/cluster 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.286 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 29,1 replyHeader:: 29,20,0 request:: '/cluster/id,#7b2276657273696f6e223a2231222c226964223a22666c515659656d615347754658465564467034436a51227d,v{s{31,s{'world,'anyone}}},0 response:: '/cluster/id 17:55:17.286 [main] INFO kafka.server.KafkaServer - Cluster ID = flQVYemaSGuFXFUdFp4CjQ 17:55:17.289 [main] WARN kafka.server.BrokerMetadataCheckpoint - No meta.properties file under dir /var/folders/_s/k06t9c8x7470lcccm39r96fc0000gp/T/kafka-1152284705018404476/meta.properties 17:55:17.307 [ThrottledRequestReaper-Fetch] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Fetch], Starting 17:55:17.308 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Fetch-delayQueue 17:55:17.309 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Produce-delayQueue 17:55:17.309 [ThrottledRequestReaper-Produce] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Produce], Starting 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.330 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 30,8 replyHeader:: 30,20,0 request:: '/brokers/topics,F response:: v{} 17:55:17.345 [main] INFO kafka.log.LogManager - Loading logs. 17:55:17.352 [main] INFO kafka.log.LogManager - Logs loading complete in 7 ms. 17:55:17.380 [main] INFO kafka.log.LogManager - Starting log cleanup with a period of 300000 ms. 17:55:17.381 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-retention with initial delay 30000 ms and period 300000 ms. 17:55:17.383 [main] INFO kafka.log.LogManager - Starting log flusher with a default period of 9223372036854775807 ms. 17:55:17.383 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-flusher with initial delay 30000 ms and period 9223372036854775807 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-recovery-point-checkpoint with initial delay 30000 ms and period 60000 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-delete-logs with initial delay 30000 ms and period 60000 ms. 17:55:17.385 [main] INFO kafka.log.LogCleaner - Starting the log cleaner 17:55:17.386 [kafka-log-cleaner-thread-0] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Starting 17:55:17.414 [main] ERROR kafka.server.KafkaServer - [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown java.lang.NoSuchMethodError: org.apache.kafka.common.network.ChannelBuilders.serverChannelBuilder(Lorg/apache/kafka/common/protocol/SecurityProtocol;Ljava/util/Map;Lorg/apache/kafka/common/security/authenticator/CredentialCache;)Lorg/apache/kafka/common/network/ChannelBuilder; at kafka.network.Processor.<init>(SocketServer.scala:422) at kafka.network.SocketServer.newProcessor(SocketServer.scala:145) at kafka.network.SocketServer$$anonfun$startup$1$$anonfun$apply$1.apply$mcVI$sp(SocketServer.scala:96) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:95) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:90) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at kafka.network.SocketServer.startup(SocketServer.scala:90) at kafka.server.KafkaServer.startup(KafkaServer.scala:215) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.415 [main] INFO kafka.server.KafkaServer - [Kafka Server 0], shutting down 17:55:17.416 [main] INFO kafka.network.SocketServer - [Socket Server on Broker 0], Shutting down 17:55:17.417 [main] WARN kafka.utils.CoreUtils$ - null java.lang.NullPointerException: null at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186) at kafka.network.SocketServer.shutdown(SocketServer.scala:129) at kafka.server.KafkaServer$$anonfun$shutdown$2.apply$mcV$sp(KafkaServer.scala:582) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:78) at kafka.utils.Logging$class.swallowWarn(Logging.scala:94) at kafka.utils.CoreUtils$.swallowWarn(CoreUtils.scala:48) at kafka.utils.Logging$class.swallow(Logging.scala:96) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:48) at kafka.server.KafkaServer.shutdown(KafkaServer.scala:582) at kafka.server.KafkaServer.startup(KafkaServer.scala:289) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.418 [main] DEBUG kafka.utils.KafkaScheduler - Shutting down task scheduler. 17:55:17.419 [main] INFO kafka.log.LogManager - Shutting down. 17:55:17.420 [main] INFO kafka.log.LogCleaner - Shutting down the log cleaner. 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutting down 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutdown completed 

EDIT :
Adding pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>hello</groupId> <artifactId>hello</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <spring-boot.version>1.5.4.RELEASE</spring-boot.version> <kafka.version>0.11.0.0</kafka.version> <java.version>1.8</java.version>  <jackson.version>2.8.9</jackson.version>  <maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.target>${java.version}</maven.compiler.target> <junit.version>4.12</junit.version> <commons-lang3.version>3.6</commons-lang3.version> <spring-kafka.version>1.2.2.RELEASE</spring-kafka.version> <!-- plugin versions --> <mongodb.version>3.4.2</mongodb.version> <docker.plugin.version>0.4.13</docker.plugin.version> <common.lang.version>1.1-SNAPSHOT</common.lang.version> <commons-collections4.version>4.0</commons-collections4.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> <version>${spring-kafka.version}</version> <exclusions> <exclusion> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>${kafka.version}</version> </dependency> <dependency> <groupId>org.mongodb</groupId> <artifactId>mongodb-driver</artifactId> <version>${mongodb.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> <exclusions> <exclusion> <groupId>org.mongodb</groupId> <artifactId>mongodb-driver</artifactId> </exclusion> </exclusions>  </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>${commons-lang3.version}</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>${commons-collections4.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-parameter-names</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jdk8</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> <version>${jackson.version}</version> </dependency> <!-- Test Dependencies --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId>  <scope>test</scope> </dependency>  <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka-test</artifactId> <version>${spring-kafka.version}</version> <scope>test</scope> </dependency>  <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.github.joelittlejohn.embedmongo</groupId> <artifactId>embedmongo-maven-plugin</artifactId> <version>0.3.4</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> </archive>  </configuration> </plugin> <plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> <version>2.2.2</version> <executions> <execution> <goals> <goal>revision</goal> </goals> </execution> </executions> <configuration> <generateGitPropertiesFile>true</generateGitPropertiesFile> <generateGitPropertiesFilename>${project.build.directory}/git.properties</generateGitPropertiesFilename>  </configuration> </plugin> </plugins> </build> </project> 
11:35:07.133 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class hello.SpringKafkaSenderTest] 11:35:07.140 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate] 11:35:07.149 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)] 11:35:07.169 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [hello.SpringKafkaSenderTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper] 11:35:07.184 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [hello.SpringKafkaSenderTest], using SpringBootContextLoader 11:35:07.190 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [hello.SpringKafkaSenderTest]: class path resource [hello/SpringKafkaSenderTest-context.xml] does not exist 11:35:07.190 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [hello.SpringKafkaSenderTest]: class path resource [hello/SpringKafkaSenderTestContext.groovy] does not exist 11:35:07.190 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [hello.SpringKafkaSenderTest]: no resource found for suffixes {-context.xml, Context.groovy}. 11:35:07.233 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [hello.SpringKafkaSenderTest] 11:35:07.236 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [hello.SpringKafkaSenderTest]: using defaults. 11:35:07.242 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener] 11:35:07.256 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Could not instantiate TestExecutionListener [org.springframework.test.context.web.ServletTestExecutionListener]. Specify custom listener classes or make the default listener classes (and their required dependencies) available. Offending class: [javax/servlet/ServletContext] 11:35:07.265 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@3dd4520b, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@5ae63ade, org.springframework.test.context.support.DirtiesContextTestExecutionListener@610694f1, org.springframework.test.context.transaction.TransactionalTestExecutionListener@43814d18, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@5c5a1b69, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@3701eaf6, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@627551fb, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@2b552920, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@2758fe70, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@1f36e637, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@578486a3] 11:35:07.266 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.267 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.277 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.278 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.279 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.279 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.280 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.280 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 11:35:07.295 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [hello.SpringKafkaSenderTest] 11:35:07.295 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [hello.SpringKafkaSenderTest] 

EDIT :
Updated my pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>hello</groupId> <artifactId>hello</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <spring-boot.version>1.5.10.RELEASE</spring-boot.version> <kafka.version>0.11.0.0</kafka.version> <java.version>1.8</java.version> <maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.target>${java.version}</maven.compiler.target> <junit.version>4.12</junit.version> <spring-kafka.version>1.3.2.RELEASE</spring-kafka.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> <version>${spring-kafka.version}</version> <exclusions> <exclusion> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> </exclusion> </exclusions> </dependency> <dependency>  <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <version>${spring-boot.version}</version> <scope>test</scope> </dependency> <dependency>  <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>${kafka.version}</version> </dependency> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka-test</artifactId> <version>${spring-kafka.version}</version> <exclusions> <exclusion> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> </exclusion> </exclusions> <scope>test</scope> </dependency> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka_2.11</artifactId> <version>0.11.0.0</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> </archive> </configuration> </plugin>    </plugins> </build> </project>  
Added POM.xml
Source Link
Sthita
  • 1.8k
  • 3
  • 19
  • 43
import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.test.rule.KafkaEmbedded; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest(classes=SpringKafkaSenderTest.class) @DirtiesContext public class SpringKafkaSenderTest { @ClassRule public static KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, "foo"); @Autowired private KafkaTemplate<String, String> template; @Test public void test() throws InterruptedException { template.send("foo", "bar"); Thread.sleep(10_000); } } 
17:55:17.285 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 28,1 replyHeader:: 28,19,0 request:: '/cluster,,v{s{31,s{'world,'anyone}}},0 response:: '/cluster 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.286 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 29,1 replyHeader:: 29,20,0 request:: '/cluster/id,#7b2276657273696f6e223a2231222c226964223a22666c515659656d615347754658465564467034436a51227d,v{s{31,s{'world,'anyone}}},0 response:: '/cluster/id 17:55:17.286 [main] INFO kafka.server.KafkaServer - Cluster ID = flQVYemaSGuFXFUdFp4CjQ 17:55:17.289 [main] WARN kafka.server.BrokerMetadataCheckpoint - No meta.properties file under dir /var/folders/_s/k06t9c8x7470lcccm39r96fc0000gp/T/kafka-1152284705018404476/meta.properties 17:55:17.307 [ThrottledRequestReaper-Fetch] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Fetch], Starting 17:55:17.308 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Fetch-delayQueue 17:55:17.309 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Produce-delayQueue 17:55:17.309 [ThrottledRequestReaper-Produce] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Produce], Starting 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.330 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 30,8 replyHeader:: 30,20,0 request:: '/brokers/topics,F response:: v{} 17:55:17.345 [main] INFO kafka.log.LogManager - Loading logs. 17:55:17.352 [main] INFO kafka.log.LogManager - Logs loading complete in 7 ms. 17:55:17.380 [main] INFO kafka.log.LogManager - Starting log cleanup with a period of 300000 ms. 17:55:17.381 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-retention with initial delay 30000 ms and period 300000 ms. 17:55:17.383 [main] INFO kafka.log.LogManager - Starting log flusher with a default period of 9223372036854775807 ms. 17:55:17.383 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-flusher with initial delay 30000 ms and period 9223372036854775807 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-recovery-point-checkpoint with initial delay 30000 ms and period 60000 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-delete-logs with initial delay 30000 ms and period 60000 ms. 17:55:17.385 [main] INFO kafka.log.LogCleaner - Starting the log cleaner 17:55:17.386 [kafka-log-cleaner-thread-0] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Starting 17:55:17.414 [main] ERROR kafka.server.KafkaServer - [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown java.lang.NoSuchMethodError: org.apache.kafka.common.network.ChannelBuilders.serverChannelBuilder(Lorg/apache/kafka/common/protocol/SecurityProtocol;Ljava/util/Map;Lorg/apache/kafka/common/security/authenticator/CredentialCache;)Lorg/apache/kafka/common/network/ChannelBuilder; at kafka.network.Processor.<init>(SocketServer.scala:422) at kafka.network.SocketServer.newProcessor(SocketServer.scala:145) at kafka.network.SocketServer$$anonfun$startup$1$$anonfun$apply$1.apply$mcVI$sp(SocketServer.scala:96) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:95) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:90) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at kafka.network.SocketServer.startup(SocketServer.scala:90) at kafka.server.KafkaServer.startup(KafkaServer.scala:215) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.415 [main] INFO kafka.server.KafkaServer - [Kafka Server 0], shutting down 17:55:17.416 [main] INFO kafka.network.SocketServer - [Socket Server on Broker 0], Shutting down 17:55:17.417 [main] WARN kafka.utils.CoreUtils$ - null java.lang.NullPointerException: null at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186) at kafka.network.SocketServer.shutdown(SocketServer.scala:129) at kafka.server.KafkaServer$$anonfun$shutdown$2.apply$mcV$sp(KafkaServer.scala:582) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:78) at kafka.utils.Logging$class.swallowWarn(Logging.scala:94) at kafka.utils.CoreUtils$.swallowWarn(CoreUtils.scala:48) at kafka.utils.Logging$class.swallow(Logging.scala:96) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:48) at kafka.server.KafkaServer.shutdown(KafkaServer.scala:582) at kafka.server.KafkaServer.startup(KafkaServer.scala:289) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.418 [main] DEBUG kafka.utils.KafkaScheduler - Shutting down task scheduler. 17:55:17.419 [main] INFO kafka.log.LogManager - Shutting down. 17:55:17.420 [main] INFO kafka.log.LogCleaner - Shutting down the log cleaner. 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutting down 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutdown completed 

EDIT :
Adding pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>hello</groupId> <artifactId>hello</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <spring-boot.version>1.5.4.RELEASE</spring-boot.version> <kafka.version>0.11.0.0</kafka.version> <java.version>1.8</java.version> <jackson.version>2.8.9</jackson.version> <maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.target>${java.version}</maven.compiler.target> <junit.version>4.12</junit.version> <commons-lang3.version>3.6</commons-lang3.version> <spring-kafka.version>1.2.2.RELEASE</spring-kafka.version> <!-- plugin versions --> <mongodb.version>3.4.2</mongodb.version> <docker.plugin.version>0.4.13</docker.plugin.version> <common.lang.version>1.1-SNAPSHOT</common.lang.version> <commons-collections4.version>4.0</commons-collections4.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> <version>${spring-kafka.version}</version> <exclusions> <exclusion> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>${kafka.version}</version> </dependency> <dependency> <groupId>org.mongodb</groupId> <artifactId>mongodb-driver</artifactId> <version>${mongodb.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> <exclusions> <exclusion> <groupId>org.mongodb</groupId> <artifactId>mongodb-driver</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>${commons-lang3.version}</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>${commons-collections4.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-parameter-names</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jdk8</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> <version>${jackson.version}</version> </dependency> <!-- Test Dependencies --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka-test</artifactId> <version>${spring-kafka.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.github.joelittlejohn.embedmongo</groupId> <artifactId>embedmongo-maven-plugin</artifactId> <version>0.3.4</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> <version>2.2.2</version> <executions> <execution> <goals> <goal>revision</goal> </goals> </execution> </executions> <configuration> <generateGitPropertiesFile>true</generateGitPropertiesFile> <generateGitPropertiesFilename>${project.build.directory}/git.properties</generateGitPropertiesFilename> </configuration> </plugin> </plugins> </build> </project> 
import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.test.rule.KafkaEmbedded; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest @DirtiesContext public class SpringKafkaSenderTest { @ClassRule public static KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, "foo"); @Autowired private KafkaTemplate<String, String> template; @Test public void test() throws InterruptedException { template.send("foo", "bar"); Thread.sleep(10_000); } } 
17:55:17.285 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 28,1 replyHeader:: 28,19,0 request:: '/cluster,,v{s{31,s{'world,'anyone}}},0 response:: '/cluster 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.286 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 29,1 replyHeader:: 29,20,0 request:: '/cluster/id,#7b2276657273696f6e223a2231222c226964223a22666c515659656d615347754658465564467034436a51227d,v{s{31,s{'world,'anyone}}},0 response:: '/cluster/id 17:55:17.286 [main] INFO kafka.server.KafkaServer - Cluster ID = flQVYemaSGuFXFUdFp4CjQ 17:55:17.289 [main] WARN kafka.server.BrokerMetadataCheckpoint - No meta.properties file under dir /var/folders/_s/k06t9c8x7470lcccm39r96fc0000gp/T/kafka-1152284705018404476/meta.properties 17:55:17.307 [ThrottledRequestReaper-Fetch] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Fetch], Starting 17:55:17.308 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Fetch-delayQueue 17:55:17.309 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Produce-delayQueue 17:55:17.309 [ThrottledRequestReaper-Produce] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Produce], Starting 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.330 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 30,8 replyHeader:: 30,20,0 request:: '/brokers/topics,F response:: v{} 17:55:17.345 [main] INFO kafka.log.LogManager - Loading logs. 17:55:17.352 [main] INFO kafka.log.LogManager - Logs loading complete in 7 ms. 17:55:17.380 [main] INFO kafka.log.LogManager - Starting log cleanup with a period of 300000 ms. 17:55:17.381 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-retention with initial delay 30000 ms and period 300000 ms. 17:55:17.383 [main] INFO kafka.log.LogManager - Starting log flusher with a default period of 9223372036854775807 ms. 17:55:17.383 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-flusher with initial delay 30000 ms and period 9223372036854775807 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-recovery-point-checkpoint with initial delay 30000 ms and period 60000 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-delete-logs with initial delay 30000 ms and period 60000 ms. 17:55:17.385 [main] INFO kafka.log.LogCleaner - Starting the log cleaner 17:55:17.386 [kafka-log-cleaner-thread-0] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Starting 17:55:17.414 [main] ERROR kafka.server.KafkaServer - [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown java.lang.NoSuchMethodError: org.apache.kafka.common.network.ChannelBuilders.serverChannelBuilder(Lorg/apache/kafka/common/protocol/SecurityProtocol;Ljava/util/Map;Lorg/apache/kafka/common/security/authenticator/CredentialCache;)Lorg/apache/kafka/common/network/ChannelBuilder; at kafka.network.Processor.<init>(SocketServer.scala:422) at kafka.network.SocketServer.newProcessor(SocketServer.scala:145) at kafka.network.SocketServer$$anonfun$startup$1$$anonfun$apply$1.apply$mcVI$sp(SocketServer.scala:96) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:95) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:90) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at kafka.network.SocketServer.startup(SocketServer.scala:90) at kafka.server.KafkaServer.startup(KafkaServer.scala:215) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.415 [main] INFO kafka.server.KafkaServer - [Kafka Server 0], shutting down 17:55:17.416 [main] INFO kafka.network.SocketServer - [Socket Server on Broker 0], Shutting down 17:55:17.417 [main] WARN kafka.utils.CoreUtils$ - null java.lang.NullPointerException: null at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186) at kafka.network.SocketServer.shutdown(SocketServer.scala:129) at kafka.server.KafkaServer$$anonfun$shutdown$2.apply$mcV$sp(KafkaServer.scala:582) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:78) at kafka.utils.Logging$class.swallowWarn(Logging.scala:94) at kafka.utils.CoreUtils$.swallowWarn(CoreUtils.scala:48) at kafka.utils.Logging$class.swallow(Logging.scala:96) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:48) at kafka.server.KafkaServer.shutdown(KafkaServer.scala:582) at kafka.server.KafkaServer.startup(KafkaServer.scala:289) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.418 [main] DEBUG kafka.utils.KafkaScheduler - Shutting down task scheduler. 17:55:17.419 [main] INFO kafka.log.LogManager - Shutting down. 17:55:17.420 [main] INFO kafka.log.LogCleaner - Shutting down the log cleaner. 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutting down 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutdown completed 
import org.junit.ClassRule; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.kafka.core.KafkaTemplate; import org.springframework.kafka.test.rule.KafkaEmbedded; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.junit4.SpringRunner; @RunWith(SpringRunner.class) @SpringBootTest(classes=SpringKafkaSenderTest.class) @DirtiesContext public class SpringKafkaSenderTest { @ClassRule public static KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, "foo"); @Autowired private KafkaTemplate<String, String> template; @Test public void test() throws InterruptedException { template.send("foo", "bar"); Thread.sleep(10_000); } } 
17:55:17.285 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 28,1 replyHeader:: 28,19,0 request:: '/cluster,,v{s{31,s{'world,'anyone}}},0 response:: '/cluster 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.285 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:create cxid:0x1d zxid:0x14 txntype:1 reqpath:n/a 17:55:17.286 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 29,1 replyHeader:: 29,20,0 request:: '/cluster/id,#7b2276657273696f6e223a2231222c226964223a22666c515659656d615347754658465564467034436a51227d,v{s{31,s{'world,'anyone}}},0 response:: '/cluster/id 17:55:17.286 [main] INFO kafka.server.KafkaServer - Cluster ID = flQVYemaSGuFXFUdFp4CjQ 17:55:17.289 [main] WARN kafka.server.BrokerMetadataCheckpoint - No meta.properties file under dir /var/folders/_s/k06t9c8x7470lcccm39r96fc0000gp/T/kafka-1152284705018404476/meta.properties 17:55:17.307 [ThrottledRequestReaper-Fetch] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Fetch], Starting 17:55:17.308 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Fetch-delayQueue 17:55:17.309 [main] DEBUG org.apache.kafka.common.metrics.Metrics - Added sensor with name Produce-delayQueue 17:55:17.309 [ThrottledRequestReaper-Produce] INFO kafka.server.ClientQuotaManager$ThrottledRequestReaper - [ThrottledRequestReaper-Produce], Starting 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - Processing request:: sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.329 [SyncThread:0] DEBUG org.apache.zookeeper.server.FinalRequestProcessor - sessionid:0x161b2a3869e0001 type:getChildren cxid:0x1e zxid:0xfffffffffffffffe txntype:unknown reqpath:/brokers/topics 17:55:17.330 [main-SendThread(127.0.0.1:59314)] DEBUG org.apache.zookeeper.ClientCnxn - Reading reply sessionid:0x161b2a3869e0001, packet:: clientPath:null serverPath:null finished:false header:: 30,8 replyHeader:: 30,20,0 request:: '/brokers/topics,F response:: v{} 17:55:17.345 [main] INFO kafka.log.LogManager - Loading logs. 17:55:17.352 [main] INFO kafka.log.LogManager - Logs loading complete in 7 ms. 17:55:17.380 [main] INFO kafka.log.LogManager - Starting log cleanup with a period of 300000 ms. 17:55:17.381 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-retention with initial delay 30000 ms and period 300000 ms. 17:55:17.383 [main] INFO kafka.log.LogManager - Starting log flusher with a default period of 9223372036854775807 ms. 17:55:17.383 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-log-flusher with initial delay 30000 ms and period 9223372036854775807 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-recovery-point-checkpoint with initial delay 30000 ms and period 60000 ms. 17:55:17.384 [main] DEBUG kafka.utils.KafkaScheduler - Scheduling task kafka-delete-logs with initial delay 30000 ms and period 60000 ms. 17:55:17.385 [main] INFO kafka.log.LogCleaner - Starting the log cleaner 17:55:17.386 [kafka-log-cleaner-thread-0] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Starting 17:55:17.414 [main] ERROR kafka.server.KafkaServer - [Kafka Server 0], Fatal error during KafkaServer startup. Prepare to shutdown java.lang.NoSuchMethodError: org.apache.kafka.common.network.ChannelBuilders.serverChannelBuilder(Lorg/apache/kafka/common/protocol/SecurityProtocol;Ljava/util/Map;Lorg/apache/kafka/common/security/authenticator/CredentialCache;)Lorg/apache/kafka/common/network/ChannelBuilder; at kafka.network.Processor.<init>(SocketServer.scala:422) at kafka.network.SocketServer.newProcessor(SocketServer.scala:145) at kafka.network.SocketServer$$anonfun$startup$1$$anonfun$apply$1.apply$mcVI$sp(SocketServer.scala:96) at scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:160) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:95) at kafka.network.SocketServer$$anonfun$startup$1.apply(SocketServer.scala:90) at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59) at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48) at kafka.network.SocketServer.startup(SocketServer.scala:90) at kafka.server.KafkaServer.startup(KafkaServer.scala:215) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.415 [main] INFO kafka.server.KafkaServer - [Kafka Server 0], shutting down 17:55:17.416 [main] INFO kafka.network.SocketServer - [Socket Server on Broker 0], Shutting down 17:55:17.417 [main] WARN kafka.utils.CoreUtils$ - null java.lang.NullPointerException: null at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at kafka.network.SocketServer$$anonfun$shutdown$3.apply(SocketServer.scala:129) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186) at kafka.network.SocketServer.shutdown(SocketServer.scala:129) at kafka.server.KafkaServer$$anonfun$shutdown$2.apply$mcV$sp(KafkaServer.scala:582) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:78) at kafka.utils.Logging$class.swallowWarn(Logging.scala:94) at kafka.utils.CoreUtils$.swallowWarn(CoreUtils.scala:48) at kafka.utils.Logging$class.swallow(Logging.scala:96) at kafka.utils.CoreUtils$.swallow(CoreUtils.scala:48) at kafka.server.KafkaServer.shutdown(KafkaServer.scala:582) at kafka.server.KafkaServer.startup(KafkaServer.scala:289) at kafka.utils.TestUtils$.createServer(TestUtils.scala:124) at kafka.utils.TestUtils.createServer(TestUtils.scala) at org.springframework.kafka.test.rule.KafkaEmbedded.before(KafkaEmbedded.java:156) at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46) at org.junit.rules.RunRules.evaluate(RunRules.java:20) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:191) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192) 17:55:17.418 [main] DEBUG kafka.utils.KafkaScheduler - Shutting down task scheduler. 17:55:17.419 [main] INFO kafka.log.LogManager - Shutting down. 17:55:17.420 [main] INFO kafka.log.LogCleaner - Shutting down the log cleaner. 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutting down 17:55:17.421 [main] INFO kafka.log.LogCleaner - [kafka-log-cleaner-thread-0], Shutdown completed 

EDIT :
Adding pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>hello</groupId> <artifactId>hello</artifactId> <version>0.0.1-SNAPSHOT</version> <properties> <spring-boot.version>1.5.4.RELEASE</spring-boot.version> <kafka.version>0.11.0.0</kafka.version> <java.version>1.8</java.version> <jackson.version>2.8.9</jackson.version> <maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.target>${java.version}</maven.compiler.target> <junit.version>4.12</junit.version> <commons-lang3.version>3.6</commons-lang3.version> <spring-kafka.version>1.2.2.RELEASE</spring-kafka.version> <!-- plugin versions --> <mongodb.version>3.4.2</mongodb.version> <docker.plugin.version>0.4.13</docker.plugin.version> <common.lang.version>1.1-SNAPSHOT</common.lang.version> <commons-collections4.version>4.0</commons-collections4.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter</artifactId> </dependency> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka</artifactId> <version>${spring-kafka.version}</version> <exclusions> <exclusion> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.kafka</groupId> <artifactId>kafka-clients</artifactId> <version>${kafka.version}</version> </dependency> <dependency> <groupId>org.mongodb</groupId> <artifactId>mongodb-driver</artifactId> <version>${mongodb.version}</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-mongodb</artifactId> <exclusions> <exclusion> <groupId>org.mongodb</groupId> <artifactId>mongodb-driver</artifactId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>${commons-lang3.version}</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-collections4</artifactId> <version>${commons-collections4.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.module</groupId> <artifactId>jackson-module-parameter-names</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jdk8</artifactId> <version>${jackson.version}</version> </dependency> <dependency> <groupId>com.fasterxml.jackson.datatype</groupId> <artifactId>jackson-datatype-jsr310</artifactId> <version>${jackson.version}</version> </dependency> <!-- Test Dependencies --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.kafka</groupId> <artifactId>spring-kafka-test</artifactId> <version>${spring-kafka.version}</version> <scope>test</scope> </dependency> <dependency> <groupId>com.h2database</groupId> <artifactId>h2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>com.github.joelittlejohn.embedmongo</groupId> <artifactId>embedmongo-maven-plugin</artifactId> <version>0.3.4</version> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <executions> <execution> <phase>install</phase> <goals> <goal>repackage</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <addDefaultImplementationEntries>true</addDefaultImplementationEntries> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>pl.project13.maven</groupId> <artifactId>git-commit-id-plugin</artifactId> <version>2.2.2</version> <executions> <execution> <goals> <goal>revision</goal> </goals> </execution> </executions> <configuration> <generateGitPropertiesFile>true</generateGitPropertiesFile> <generateGitPropertiesFilename>${project.build.directory}/git.properties</generateGitPropertiesFilename> </configuration> </plugin> </plugins> </build> </project> 
deleted 1 character in body
Source Link
Sthita
  • 1.8k
  • 3
  • 19
  • 43
Loading
Source Link
Sthita
  • 1.8k
  • 3
  • 19
  • 43
Loading