question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Classpath strangeness with 1.0.4+

See original GitHub issue

I 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 dependency
  • project 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 on project A via dependsOn in the build.sbt
  • project B has specs2 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:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
eed3si9ncommented, Jan 4, 2020

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?)

Does this go away if you forked the test?

Test / fork := true
0reactions
NeQuissimuscommented, Jan 5, 2020

I have not seen this issue in a very long time. I think we can close this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Studio java-library module classpath ... - Stack Overflow
Android Studio java-library module classpath NoClassDefFoundError ... I looked into Domain.iml file and I found something strange:
Read more >
Strange setup_nctoolbox error · Issue #59 · nctoolbox ... - GitHub
The upshot is that the 1.0.x does not contain a log4j.jar . The current version of Matlab (R2014b) has that jar on the...
Read more >
[JavaSpecialists 037] - Checking That Your Classpath Is Valid
Abstract: One of the challenges Java programmers had in the early days was to get the classpath right.
Read more >
classpath : Java Glossary - Canadian Mind Products
The CLASSPATH is an environment variable that tells the Java compiler javac.exe where to look for class files to import or java.exe where...
Read more >
[JDK-7146424] Wildcard expansion for single entry classpath
A DESCRIPTION OF THE PROBLEM : Wildcard expansion doesn't work correctly for -classpath (-cp) parameter when only one entry is specified. ... option[...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found