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.

ClassLoaderLayeringStrategy.ScalaLibrary breaks scalatest

See original GitHub issue

Hi,

Seems like ClassLoaderLayeringStrategy.ScalaLibrary in 1.3.0-RC1 breaks scalatest with the a cryptic message. Surprisingly default setting works, as well as .Flat. I guess it’s not a bug but could anyone explain this behaviour? From my understanding of the new scheme it should work fine.

[error] java.lang.NoClassDefFoundError: scala/reflect/runtime/package$
[error] 	at org.scalatest.tools.Framework.runner(Framework.scala:985)
[error] 	at sbt.Defaults$.$anonfun$createTestRunners$1(Defaults.scala:1003)
[error] 	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:237)
[error] 	at scala.collection.immutable.Map$Map1.foreach(Map.scala:128)
[error] 	at scala.collection.TraversableLike.map(TraversableLike.scala:237)
[error] 	at scala.collection.TraversableLike.map$(TraversableLike.scala:230)
[error] 	at scala.collection.AbstractTraversable.map(Traversable.scala:108)
[error] 	at sbt.Defaults$.createTestRunners(Defaults.scala:997)
[error] 	at sbt.Defaults$.allTestGroupsTask(Defaults.scala:1065)
[error] 	at sbt.Defaults$.$anonfun$testTasks$10(Defaults.scala:804)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] 	at sbt.std.Transform$$anon$4.work(Transform.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:270)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:19)
[error] 	at sbt.Execute.work(Execute.scala:279)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:270)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:834)

sbt 1.3.0-RC1 scala 2.12.8 scalatest 3.0.7

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
eed3si9ncommented, May 20, 2019
0reactions
eed3si9ncommented, May 17, 2019

Perhaps, but I’m still a bit confused as to why this is happening because scala reflect is in the ivy.xml for scalatest so the scala reflect jar should be in the layer that contains the scalatest jar.

It’s me. I think broke it in https://github.com/sbt/sbt/pull/4671.

    val dynamicClasspath =
     fullCP.filterNot(testDependencySet ++ runtimeDependencies ++ si.allJars)

I missed the si.allJars here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sbt/sbt - Gitter
I've tried to add ThisBuild / classLoaderLayeringStrategy := ClassLoaderLayeringStrategy.ScalaLibrary in build.sbt but still I hit the same problem.
Read more >
Kafka Streams 2.3 to 2.5 upgrade breaks Scala compilation
I just had to upgrade my Scala version to the one published in the "Compiled Dependencies" section here, which is: scalaVersion := "2.12.10"....
Read more >
In process class loading
It is specified via the classLoaderLayeringStrategy . There are three possible values: ScalaLibrary - The parent of the outermost layer is able to...
Read more >
Scala: build.sbt
As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers.
Read more >
Scala is a Maintenance Nightmare
This post explains why it's so hard to maintain Scala projects (binary incombatilbilities, frequent breaking changes, SBT plugins, ...
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