Classpath strangeness with 1.0.4+
See original GitHub issueI am encountering an issue that I cannot find out enough about to really point anybody in a concrete direction.
So let me provide as much information as possible:
I have a multi-project build.sbt
that uses sbt 1.1.1.
project A
contains a Kafka Streams dependencyproject B
also contains a Kafka Streams dependency (which I do not really need but I like it for clarity rather than transitively) and a dependency onproject A
viadependsOn
in thebuild.sbt
project B
hasspecs2
tests
When I issue sbt projectB/test
, all tests pass.
Then I run sbt project/test
again (without changes), I get a stack trace similar to the following:
java.lang.ExceptionInInitializerError
at org.apache.kafka.streams.KafkaStreams.<init>(KafkaStreams.java:509)
at com.nequissimus.norm.Foo$.$anonfun$prepare$1(Foo.scala:61)
at scalaz.effect.IO$.$anonfun$apply$2(IO.scala:178)
at scalaz.std.FunctionInstances$$anon$1.$anonfun$map$1(Function.scala:77)
at scalaz.Free.$anonfun$run$1(Free.scala:271)
at scalaz.Free.go2$1(Free.scala:162)
at scalaz.Free.go(Free.scala:165)
at scalaz.Free.run(Free.scala:271)
at scalaz.effect.IO.unsafePerformIO(IO.scala:22)
at com.nequissimus.norm.FooSpec.$anonfun$duo2cloudlog$5(FooSpec.scala:61)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
at scala.concurrent.Future$.$anonfun$apply$1(Future.scala:655)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:289)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:60)
at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:140)
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)
Caused 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.
at org.apache.kafka.common.config.ConfigDef.parseType(ConfigDef.java:715)
at org.apache.kafka.common.config.ConfigDef$ConfigKey.<init>(ConfigDef.java:945)
at org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:137)
at org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:157)
at org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:196)
at org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:358)
at org.apache.kafka.common.config.ConfigDef.define(ConfigDef.java:371)
at org.apache.kafka.streams.StreamsConfig.<clinit>(StreamsConfig.java:309)
... 23 more
If I change anything inside the test specification (FooSpec
) then sbt projectB/test
will work again, exactly once.
This issue seems to be new to sbt 1.0.4 (I do not encounter the same problem with 0.13.17 or 1.0.{0, 1, 2, 3} but do with 1.0.4 and 1.1.1; I literally just tried all of these)
The interesting bit (to me) here is that Kafka throws an exception that would typically indicate that an old version of kafka-clients
is present. However, nowhere in my dependency tree, such version can be found. So I presume something else is going on that I do not understand (a class unloaded?)
This is really beyond my understanding of internals, I hope somebody can make sense of this.
I am willing to provide additional information if somebody points me in the right direction.
Unfortunately, I was unable to create a minimal reproduction (I tried).
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (2 by maintainers)
Top GitHub Comments
Does this go away if you forked the test?
I have not seen this issue in a very long time. I think we can close this issue.