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

Enrico Olivelli commented on KAFKA-6757:
----------------------------------------

I am sending a pull request for this trivial change

> Log runtime exception in case of server startup errors
> ------------------------------------------------------
>
>                 Key: KAFKA-6757
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6757
>             Project: Kafka
>          Issue Type: Improvement
>          Components: log
>    Affects Versions: 1.0.1
>            Reporter: Enrico Olivelli
>            Priority: Minor
>
> Sometimes while running Kafka server inside tests of an upstream application 
> it can happen that the server cannot start due to a bad runtime error, like a 
> missing jar on the classpath.
> I would like KafkaServerStartable to log any 'Throwable' in order to catch 
> this unpredictable errors
>  
> like this
> {code:java}
> java.lang.NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonMerge
>     at 
> com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector.<clinit>(JacksonAnnotationIntrospector.java:50)
>     at 
> com.fasterxml.jackson.databind.ObjectMapper.<clinit>(ObjectMapper.java:291)
>     at kafka.utils.Json$.<init>(Json.scala:29)
>     at kafka.utils.Json$.<clinit>(Json.scala)
>     at kafka.utils.ZkUtils$ClusterId$.toJson(ZkUtils.scala:299)
>     at kafka.utils.ZkUtils.createOrGetClusterId(ZkUtils.scala:314)
>     at 
> kafka.server.KafkaServer$$anonfun$getOrGenerateClusterId$1.apply(KafkaServer.scala:356)
>     at 
> kafka.server.KafkaServer$$anonfun$getOrGenerateClusterId$1.apply(KafkaServer.scala:356)
>     at scala.Option.getOrElse(Option.scala:121)
>     at kafka.server.KafkaServer.getOrGenerateClusterId(KafkaServer.scala:356)
>     at kafka.server.KafkaServer.startup(KafkaServer.scala:197)
>     at 
> kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:38)
>     at 
> magnews.datastream.server.DataStreamServer.start(DataStreamServer.java:96)
>     at 
> magnews.datastream.server.RealServerSinglePartitionTest.test(RealServerSinglePartitionTest.java:85)
>     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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>     at 
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>     at 
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>     at 
> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>     at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>     at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325){code}



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

Reply via email to