Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error when plugin is use together with newer play framework versions (>=2.9) #189

Closed
fabro122 opened this issue Nov 13, 2023 · 2 comments

Comments

@fabro122
Copy link

fabro122 commented Nov 13, 2023

Edit: Solved (see comment below)

Since I wanted to use Scala 3 I tried to upgrade to Play Framework 3.0.0, but after upgrading the sbt cli fails already on startup (without providing any command or task) with an error (see below). The error occurs with Scala 2.13.12 or 3.3.1, sbt 1.9.6 or 1.9.7 and play 2.9.0 or 3.0.0. Using the newer play versions or sbt-web-scalajs with Scala 3 individually works however. The only immediate change I found between play 2.9.0 and play 2.8.x is, that Scala 2.12 support has been dropped.
Thanks for the help!

To Reproduce:

  1. Create new Project from gitter template: sbt new vmunier/play-scalajs.g8
  2. Change sbt play plugin to
    addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.0") or
    addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.9.0")

P.S.: I raised the issue in this repository, because I think it is the most likely one able to address it.

java.lang.NoClassDefFoundError: org/webjars/WebJarExtractor$Cache
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:534)
at java.base/java.lang.Class.forName(Class.java:513)
at sbt.internal.inc.ModuleUtilities$.getObject(ModuleUtilities.scala:24)
at sbt.internal.inc.ModuleUtilities$.getCheckedObject(ModuleUtilities.scala:32)
at sbt.internal.inc.ModuleUtilities$.$anonfun$getCheckedObjects$1(ModuleUtilities.scala:37)
at scala.collection.immutable.Stream.$anonfun$map$1(Stream.scala:418)
at scala.collection.immutable.Stream$Cons.tail(Stream.scala:1173)
at scala.collection.immutable.Stream$Cons.tail(Stream.scala:1163)
at scala.collection.generic.Growable.loop$1(Growable.scala:57)
at scala.collection.generic.Growable.$plus$plus$eq(Growable.scala:61)
at scala.collection.generic.Growable.$plus$plus$eq$(Growable.scala:53)
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:184)
at scala.collection.mutable.ListBuffer.$plus$plus$eq(ListBuffer.scala:47)
at scala.collection.TraversableLike.to(TraversableLike.scala:786)
at scala.collection.TraversableLike.to$(TraversableLike.scala:783)
at scala.collection.AbstractTraversable.to(Traversable.scala:108)
at scala.collection.TraversableOnce.toList(TraversableOnce.scala:350)
at scala.collection.TraversableOnce.toList$(TraversableOnce.scala:350)
at scala.collection.AbstractTraversable.toList(Traversable.scala:108)
at scala.collection.immutable.List.$plus$plus(List.scala:216)
at sbt.internal.PluginDiscovery$.discoverAll(PluginDiscovery.scala:59)
at sbt.internal.Load$.loadPlugins(Load.scala:1330)
at sbt.internal.Load$.loadPluginDefinition(Load.scala:1275)
at sbt.internal.Load$.buildPlugins(Load.scala:1254)
at sbt.internal.Load$.plugins(Load.scala:1233)
at sbt.internal.Load$.$anonfun$loadUnit$2(Load.scala:701)
at sbt.internal.Load$.timed(Load.scala:1407)
at sbt.internal.Load$.$anonfun$loadUnit$1(Load.scala:701)
at sbt.internal.Load$.timed(Load.scala:1407)
at sbt.internal.Load$.loadUnit(Load.scala:695)
at sbt.internal.Load$.$anonfun$builtinLoader$4(Load.scala:493)
at sbt.internal.BuildLoader$.$anonfun$componentLoader$5(BuildLoader.scala:181)
at sbt.internal.BuildLoader.apply(BuildLoader.scala:246)
at sbt.internal.Load$.loadURI$1(Load.scala:555)
at sbt.internal.Load$.loadAll(Load.scala:571)
at sbt.internal.Load$.loadURI(Load.scala:501)
at sbt.internal.Load$.load(Load.scala:480)
at sbt.internal.Load$.$anonfun$apply$1(Load.scala:242)
at sbt.internal.Load$.timed(Load.scala:1407)
at sbt.internal.Load$.apply(Load.scala:242)
at sbt.internal.Load$.defaultLoad(Load.scala:57)
at sbt.BuiltinCommands$.liftedTree1$1(Main.scala:964)
at sbt.BuiltinCommands$.doLoadProject(Main.scala:964)
at sbt.BuiltinCommands$.$anonfun$loadProjectImpl$2(Main.scala:917)
at sbt.Command$.$anonfun$applyEffect$4(Command.scala:151)
at sbt.Command$.$anonfun$applyEffect$2(Command.scala:146)
at sbt.Command$.process(Command.scala:190)
at sbt.MainLoop$.$anonfun$processCommand$5(MainLoop.scala:246)
at scala.Option.getOrElse(Option.scala:189)
at sbt.MainLoop$.process$1(MainLoop.scala:246)
at sbt.MainLoop$.processCommand(MainLoop.scala:279)
at sbt.MainLoop$.$anonfun$next$5(MainLoop.scala:164)
at sbt.State$StateOpsImpl$.runCmd$1(State.scala:290)
at sbt.State$StateOpsImpl$.process$extension(State.scala:326)
at sbt.MainLoop$.$anonfun$next$4(MainLoop.scala:164)
at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:24)
at sbt.MainLoop$.next(MainLoop.scala:164)
at sbt.MainLoop$.run(MainLoop.scala:145)
at sbt.MainLoop$.$anonfun$runWithNewLog$1(MainLoop.scala:120)
at sbt.io.Using.apply(Using.scala:28)
at sbt.MainLoop$.runWithNewLog(MainLoop.scala:113)
at sbt.MainLoop$.runAndClearLast(MainLoop.scala:67)
at sbt.MainLoop$.runLoggedLoop(MainLoop.scala:52)
at sbt.MainLoop$.runLogged(MainLoop.scala:43)
at sbt.StandardMain$.runManaged(Main.scala:225)
at sbt.xMain$.$anonfun$run$11(Main.scala:135)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
at scala.Console$.withIn(Console.scala:230)
at sbt.internal.util.Terminal$.withIn(Terminal.scala:610)
at sbt.internal.util.Terminal$.$anonfun$withStreams$1(Terminal.scala:390)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
at scala.Console$.withOut(Console.scala:167)
at sbt.internal.util.Terminal$.$anonfun$withOut$2(Terminal.scala:600)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
at scala.Console$.withErr(Console.scala:196)
at sbt.internal.util.Terminal$.withOut(Terminal.scala:600)
at sbt.internal.util.Terminal$.withStreams(Terminal.scala:390)
at sbt.xMain$.withStreams$1(Main.scala:88)
at sbt.xMain$.run(Main.scala:123)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at sbt.internal.XMainConfiguration.run(XMainConfiguration.java:59)
at sbt.xMain.run(Main.scala:47)
at xsbt.boot.Launch$.$anonfun$run$1(Launch.scala:149)
at xsbt.boot.Launch$.withContextLoader(Launch.scala:176)
at xsbt.boot.Launch$.run(Launch.scala:149)
at xsbt.boot.Launch$.$anonfun$apply$1(Launch.scala:44)
at xsbt.boot.Launch$.launch(Launch.scala:159)
at xsbt.boot.Launch$.apply(Launch.scala:44)
at xsbt.boot.Launch$.apply(Launch.scala:21)
at xsbt.boot.Boot$.runImpl(Boot.scala:78)
at xsbt.boot.Boot$.run(Boot.scala:73)
at xsbt.boot.Boot$.main(Boot.scala:21)
at xsbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: org.webjars.WebJarExtractor$Cache
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:593)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
@fabro122
Copy link
Author

fabro122 commented Nov 13, 2023

After cloning and playing a bit around with the dependency versions, I found out, that with newer versions of sbt-web (1.5.3 and 1.5.4respectively) everything works fine.
I hope you could merge the PRs of @scala-steward and publish it in the near future.
Thanks!

@vmunier
Copy link
Owner

vmunier commented Nov 14, 2023

sbt-web-scalajs v1.3.0 has been released and should fix this issue.

@vmunier vmunier closed this as completed Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants