{"action":"created","issue":{"url":"https://api.github.com/repos/typelevel/cats-effect/issues/360","repository_url":"https://api.github.com/repos/typelevel/cats-effect","labels_url":"https://api.github.com/repos/typelevel/cats-effect/issues/360/labels{/name}","comments_url":"https://api.github.com/repos/typelevel/cats-effect/issues/360/comments","events_url":"https://api.github.com/repos/typelevel/cats-effect/issues/360/events","html_url":"https://github.com/typelevel/cats-effect/issues/360","id":359683060,"node_id":"MDU6SXNzdWUzNTk2ODMwNjA=","number":360,"title":"Kafka streams error with IOApp","user":{"login":"barambani","id":201339,"node_id":"MDQ6VXNlcjIwMTMzOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/201339?v=4","gravatar_id":"","url":"https://api.github.com/users/barambani","html_url":"https://github.com/barambani","followers_url":"https://api.github.com/users/barambani/followers","following_url":"https://api.github.com/users/barambani/following{/other_user}","gists_url":"https://api.github.com/users/barambani/gists{/gist_id}","starred_url":"https://api.github.com/users/barambani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barambani/subscriptions","organizations_url":"https://api.github.com/users/barambani/orgs","repos_url":"https://api.github.com/users/barambani/repos","events_url":"https://api.github.com/users/barambani/events{/privacy}","received_events_url":"https://api.github.com/users/barambani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-12T23:02:47Z","updated_at":"2018-09-14T08:49:05Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"In a project I'm working on I'm noticing a behaviour that might be expected but that I don't understand completely. I tried to implement a kafka streams application using the IOApp, mainly asynchronously starting the `KafkaStreams` in the `run`. At runtime I get\r\n```\r\njava.lang.ExceptionInInitializerError\r\n\tat org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:538)\r\n\tat Main$.$anonfun$run$1(Main.scala:22)\r\n\tat cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:85)\r\n\tat cats.effect.internals.IORunLoop$.start(IORunLoop.scala:34)\r\n\tat cats.effect.internals.IOBracket$.$anonfun$apply$1(IOBracket.scala:36)\r\n\tat cats.effect.internals.IOBracket$.$anonfun$apply$1$adapted(IOBracket.scala:33)\r\n\tat cats.effect.internals.IORunLoop$RestartCallback.start(IORunLoop.scala:328)\r\n\tat cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:117)\r\n\tat cats.effect.internals.IORunLoop$RestartCallback.signal(IORunLoop.scala:336)\r\n\tat cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:357)\r\n\tat cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:303)\r\n\tat cats.effect.internals.IOShift$Tick.run(IOShift.scala:36)\r\n\tat java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1402)\r\n\tat java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)\r\n\tat java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)\r\n\tat java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)\r\n\tat java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)\r\nCaused by: org.apache.kafka.common.config.ConfigException: Invalid value org.apache.kafka.streams.errors.LogAndFailExceptionHandler for configuration default.deserialization.exception.handler: Class org.apache.kafka.streams.errors.LogAndFailExceptionHandler could not be found.\r\n\tat org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:724)\r\n\tat org.apache.kafka.common.config.ConfigDef$ConfigKey.<init>(ConfigDef.java:1043)\r\n\tat org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:146)\r\n\tat org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:166)\r\n\tat org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:205)\r\n\tat org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:367)\r\n\tat org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:380)\r\n\tat org.apache.kafka.streams.StreamsConfig.<clinit>(StreamsConfig.java:505)\r\n\t... 17 more\r\n``` \r\nI have been able to reduce the case a bit in [this repo](https://github.com/barambani/kafka-streams-error). When I change the app to extend `IOApp.WithContext` like in [this comment](https://github.com/barambani/kafka-streams-error/blob/master/src/main/scala/Main.scala#L40) it runs ok. It looks like that to work, the kafka stream needs to shift to another context. What could it be the reason for that ? Should be expected or is it an issue ?"},"comment":{"url":"https://api.github.com/repos/typelevel/cats-effect/issues/comments/421278178","html_url":"https://github.com/typelevel/cats-effect/issues/360#issuecomment-421278178","issue_url":"https://api.github.com/repos/typelevel/cats-effect/issues/360","id":421278178,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTI3ODE3OA==","user":{"login":"barambani","id":201339,"node_id":"MDQ6VXNlcjIwMTMzOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/201339?v=4","gravatar_id":"","url":"https://api.github.com/users/barambani","html_url":"https://github.com/barambani","followers_url":"https://api.github.com/users/barambani/followers","following_url":"https://api.github.com/users/barambani/following{/other_user}","gists_url":"https://api.github.com/users/barambani/gists{/gist_id}","starred_url":"https://api.github.com/users/barambani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/barambani/subscriptions","organizations_url":"https://api.github.com/users/barambani/orgs","repos_url":"https://api.github.com/users/barambani/repos","events_url":"https://api.github.com/users/barambani/events{/privacy}","received_events_url":"https://api.github.com/users/barambani/received_events","type":"User","site_admin":false},"created_at":"2018-09-14T08:49:05Z","updated_at":"2018-09-14T08:49:05Z","author_association":"CONTRIBUTOR","body":"I see the point, and it will be a further step forward. In relation to my issue I have a workaround, as said above. I will try to understand the root cause for few more days, as I'm now looking also into sbt now. Something funny is happening with the class loader when the demon kafka streams thread in `start` runs in the IOApp run loop. I will close this ticket at the end. "}}
{"actor":{"display_login":"barambani"}}