scaladependenciessbtnoclassdeffounderrorbinary-compatibility

NoClassDefFoundError: scala/collection/TraversableOnce (Using Phantom Library To Fetch Data From ScyllaDB Cluster)


I'm new to scyllaDB, I've made 3 Node ScyllaDb Cluster and it's running.

Datacenter: DC1
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
--  Address     Load       Tokens       Owns    Host ID                               Rack
UN  172.19.0.3  768 KB     256          ?       e2cebffb-48b2-44f4-8e99-b0cd6b9e6d0f  Rack1
UN  172.19.0.2  544 KB     256          ?       91cea479-adfb-4110-b69c-c3eb0b13876f  Rack1
UN  172.19.0.4  768 KB     256          ?       3f130c04-adb2-430f-9fd2-2d12d1f074db  Rack1

Now I'm making simple scala application which will fetch records from scyllaDB. User Model:

case class User(id: Int, first_name: String, last_name: String)

User Table:

import com.outworkers.phantom.dsl._

abstract class UsersTable extends Table[UsersTable,User]{
  override def tableName: String = "users"

  object id extends IntColumn with PartitionKey

  object firstName extends StringColumn {
    override def name: String = "first_name"
  }

  object lastName extends StringColumn {
    override def name: String = "last_name"
  }
}

User Database:

    import com.outworkers.phantom.dsl._

class UserDatabase(override val connector: CassandraConnection)
  extends Database[UserDatabase](connector) {

  object users extends UsersTable with Connector
}

Service Class:

import com.outworkers.phantom.dsl._

import scala.concurrent.Future

class UserDatabaseService(db: UserDatabase) {

  import db.{session, space}

  def getAll(): Future[List[User]] = {
    db.users.select.all().fetch()
  }

}

Main Class:

import com.outworkers.phantom.dsl._

import scala.util.{Failure, Success}

object App {
  def main(args: Array[String]): Unit = {
    val connection: CassandraConnection = ContactPoints(List("scylla-node1", "scylla-node2", "scylla-node3"))
      .keySpace("user_keyspace")

    val db = new UserDatabase(connection)
    val service = new UserDatabaseService(db)

    service.getAll().andThen {
      case Success(users) =>
        println("Users: " + users.mkString("(", ",", ")"))
        db.shutdown()

      case Failure(exception) =>
        println("Exception: " + exception)
        db.shutdown()
    }
  }

}

build.sbt:

ThisBuild / version := "0.1.0-SNAPSHOT"

ThisBuild / scalaVersion := "2.13.1"

lazy val root = (project in file("."))
  .settings(
    name := "scylladb_practice"
  )

libraryDependencies += "com.outworkers" % "phantom-dsl_2.12" % "2.30.0"

Now the problem is when I run this program, it gives exception:

    [error] ## Exception when compiling 5 sources to /home/zaryab/Downloads/scylladb_practice/target/scala-2.13/classes
    [error] scala/collection/TraversableOnce
    [error] java.base/java.lang.Class.forName0(Native Method)
    [error] java.base/java.lang.Class.forName(Class.java:398)
    [error] scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers.resolveJavaReflectionRuntime(JavaReflectionRuntimes.scala:28)
    [error] scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers.resolveJavaReflectionRuntime$(JavaReflectionRuntimes.scala:27)
    [error] scala.reflect.macros.runtime.MacroRuntimes$MacroRuntimeResolver.resolveJavaReflectionRuntime(MacroRuntimes.scala:61)
    [error] scala.reflect.macros.runtime.MacroRuntimes$MacroRuntimeResolver.resolveRuntime(MacroRuntimes.scala:74)
    [error] scala.reflect.macros.runtime.MacroRuntimes.$anonfun$standardMacroRuntime$3(MacroRuntimes.scala:47)
    [error] scala.collection.mutable.MapOps.getOrElseUpdate(Map.scala:148)
    [error] scala.collection.mutable.MapOps.getOrElseUpdate$(Map.scala:145)
    [error] scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:268)
    [error] scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime(MacroRuntimes.scala:47)
    [error] scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime$(MacroRuntimes.scala:40)
    [error] scala.tools.nsc.Global$$anon$5.standardMacroRuntime(Global.scala:483)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$12.default(AnalyzerPlugins.scala:472)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$12.default(AnalyzerPlugins.scala:469)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:410)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime(AnalyzerPlugins.scala:469)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime$(AnalyzerPlugins.scala:469)
    [error] scala.tools.nsc.Global$$anon$5.pluginsMacroRuntime(Global.scala:483)
    [error] scala.reflect.macros.runtime.MacroRuntimes.macroRuntime(MacroRuntimes.scala:34)
    [error] scala.reflect.macros.runtime.MacroRuntimes.macroRuntime$(MacroRuntimes.scala:34)
    [error] scala.tools.nsc.Global$$anon$5.macroRuntime(Global.scala:483)
    [error] scala.tools.nsc.typechecker.Macros$MacroExpander.$anonfun$expand$1(Macros.scala:563)
    [error] scala.tools.nsc.Global.withInfoLevel(Global.scala:226)
    [error] scala.tools.nsc.typechecker.Macros$MacroExpander.expand(Macros.scala:557)
    [error] scala.tools.nsc.typechecker.Macros$MacroExpander.apply(Macros.scala:544)
    [error] scala.tools.nsc.typechecker.Macros.standardMacroExpand(Macros.scala:719)
    [error] scala.tools.nsc.typechecker.Macros.standardMacroExpand$(Macros.scala:717)
    [error] scala.tools.nsc.Global$$anon$5.standardMacroExpand(Global.scala:483)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$10.default(AnalyzerPlugins.scala:456)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$10.default(AnalyzerPlugins.scala:453)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:410)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroExpand(AnalyzerPlugins.scala:453)
    [error] scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroExpand$(AnalyzerPlugins.scala:453)
    [error] scala.tools.nsc.Global$$anon$5.pluginsMacroExpand(Global.scala:483)
    [error] scala.tools.nsc.typechecker.Macros.macroExpand(Macros.scala:708)
    [error] scala.tools.nsc.typechecker.Macros.macroExpand$(Macros.scala:701)
    [error] scala.tools.nsc.Global$$anon$5.macroExpand(Global.scala:483)
    [error] scala.tools.nsc.typechecker.Typers$Typer.vanillaAdapt$1(Typers.scala:1212)
    [error] scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1277)
    [error] scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1250)
    [error] scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1270)
    [error] scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit1(Implicits.scala:866)
    [error] scala.tools.nsc.typechecker.Implicits$ImplicitSearch.typedImplicit0(Implicits.scala:803)
    [error] scala.tools.nsc.typechecker.Implicits$ImplicitSearch.scala$tools$nsc$typechecker$Implicits$ImplicitSearch$$typedImplicit(Implicits.scala:622)
    [error] scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankImplicits(Implicits.scala:1213)
    [error] scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBest(Implicits.scala:1248)
    [error] scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:1305)
    [error] scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1730)
    [error] scala.tools.nsc.typechecker.Implicits.inferImplicit1(Implicits.scala:112)
    [error] scala.tools.nsc.typechecker.Implicits.inferImplicit(Implicits.scala:91)
    [error] scala.tools.nsc.typechecker.Implicits.inferImplicit$(Implicits.scala:88)
    [error] scala.tools.nsc.Global$$anon$5.inferImplicit(Global.scala:483)
    [error] scala.tools.nsc.typechecker.Implicits.inferImplicitFor(Implicits.scala:46)
    [error] scala.tools.nsc.typechecker.Implicits.inferImplicitFor$(Implicits.scala:45)
    [error] scala.tools.nsc.Global$$anon$5.inferImplicitFor(Global.scala:483)
    [error] scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:270)
    [error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$adapt$1(Typers.scala:879)
    [error] scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:499)
    [error] scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1273)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5900)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5950)
    [error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3394)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3394)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2536)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5815)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5850)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5886)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:5948)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5793)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5886)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5950)
    [error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3394)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3394)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2049)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1879)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5794)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5886)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5950)
    [error] scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3394)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3394)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5494)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5797)
    [error] scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5886)
    [error] scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.apply(Analyzer.scala:115)
    [error] scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:452)
    [error] scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.run(Analyzer.scala:104)
    [error] scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1506)
    [error] scala.tools.nsc.Global$Run.compileUnits(Global.scala:1490)
    [error] scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
    [error] scala.tools.nsc.Global$Run.compile(Global.scala:1614)
    [error] xsbt.CachedCompiler0.run(CompilerInterface.scala:130)
    [error] xsbt.CachedCompiler0.run(CompilerInterface.scala:105)
    [error] xsbt.CompilerInterface.run(CompilerInterface.scala:31)
    [error] java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [error] java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [error] java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [error] java.base/java.lang.reflect.Method.invoke(Method.java:566)
    [error] sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
    [error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
    [error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
    [error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
    [error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
    [error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
    [error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
    [error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
    [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
    [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
    [error] sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
    [error] sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
    [error] sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
    [error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
    [error] sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
    [error] sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
    [error] sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
    [error] sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
    [error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
    [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
    [error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
    [error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
    [error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
    [error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
    [error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
    [error] scala.Function1.$anonfun$compose$1(Function1.scala:44)
    [error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
    [error] sbt.std.Transform$$anon$4.work(System.scala:67)
    [error] sbt.Execute.$anonfun$submit$2(Execute.scala:269)
    [error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
    [error] sbt.Execute.work(Execute.scala:278)
    [error] sbt.Execute.$anonfun$submit$1(Execute.scala:269)
    [error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
    [error] sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
    [error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    [error] java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    [error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    [error] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    [error] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    [error] java.base/java.lang.Thread.run(Thread.java:834)
    [error]            
    [error] java.lang.NoClassDefFoundError: scala/collection/TraversableOnce
    [error]     at java.base/java.lang.Class.forName0(Native Method)
    [error]     at java.base/java.lang.Class.forName(Class.java:398)
    [error]     at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers.resolveJavaReflectionRuntime(JavaReflectionRuntimes.scala:28)
    [error]     at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers.resolveJavaReflectionRuntime$(JavaReflectionRuntimes.scala:27)
    [error]     at scala.reflect.macros.runtime.MacroRuntimes$MacroRuntimeResolver.resolveJavaReflectionRuntime(MacroRuntimes.scala:61)
    [error]     at scala.reflect.macros.runtime.MacroRuntimes$MacroRuntimeResolver.resolveRuntime(MacroRuntimes.scala:74)
    [error]     at scala.reflect.macros.runtime.MacroRuntimes.$anonfun$standardMacroRuntime$3(MacroRuntimes.scala:47)
    [error]     at scala.collection.mutable.MapOps.getOrElseUpdate(Map.scala:148)
    [error]     at scala.collection.mutable.MapOps.getOrElseUpdate$(Map.scala:145)
    [error]     at scala.collection.mutable.AbstractMap.getOrElseUpdate(Map.scala:268)
    [error]     at scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime(MacroRuntimes.scala:47)
    [error]     at scala.reflect.macros.runtime.MacroRuntimes.standardMacroRuntime$(MacroRuntimes.scala:40)
    [error]     at scala.tools.nsc.Global$$anon$5.standardMacroRuntime(Global.scala:483)
    [error]     at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$12.default(AnalyzerPlugins.scala:472)
    [error]     at scala.tools.nsc.typechecker.AnalyzerPlugins$$anon$12.default(AnalyzerPlugins.scala:469)
    [error]     at scala.tools.nsc.typechecker.AnalyzerPlugins.invoke(AnalyzerPlugins.scala:410)
    [error]     at scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime(AnalyzerPlugins.scala:469)
    [error]     at scala.tools.nsc.typechecker.AnalyzerPlugins.pluginsMacroRuntime$(AnalyzerPlugins.scala:469)
scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.rankImplicits(Implicits.scala:1213)
    [error]     at scala.tools.nsc.typechecker.Implicits$ImplicitSearch$ImplicitComputation.findBest(Implicits.scala:1248)
    [error]     at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.searchImplicit(Implicits.scala:1305)
    [error]     at scala.tools.nsc.typechecker.Implicits$ImplicitSearch.bestImplicit(Implicits.scala:1730)
    [error]     at scala.tools.nsc.typechecker.Implicits.inferImplicit1(Implicits.scala:112)
    [error]     at scala.tools.nsc.typechecker.Implicits.inferImplicit(Implicits.scala:91)
    [error]     at scala.tools.nsc.typechecker.Implicits.inferImplicit$(Implicits.scala:88)
    [error]     at scala.tools.nsc.Global$$anon$5.inferImplicit(Global.scala:483)
    [error]     at scala.tools.nsc.typechecker.Implicits.inferImplicitFor(Implicits.scala:46)
    [error]     at scala.tools.nsc.typechecker.Implicits.inferImplicitFor$(Implicits.scala:45)
    [error]     at scala.tools.nsc.Global$$anon$5.inferImplicitFor(Global.scala:483)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.applyImplicitArgs(Typers.scala:270)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$adapt$1(Typers.scala:879)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.adaptToImplicitMethod$1(Typers.scala:499)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.adapt(Typers.scala:1273)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5900)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5950)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3394)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3394)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedBlock(Typers.scala:2536)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedOutsidePatternMode$1(Typers.scala:5815)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5850)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5886)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedDefDef(Typers.scala:5948)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5793)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5886)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5950)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3394)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3394)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedTemplate(Typers.scala:2049)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedClassDef(Typers.scala:1879)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5794)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5886)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedStat$1(Typers.scala:5950)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.$anonfun$typedStats$10(Typers.scala:3394)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedStats(Typers.scala:3394)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typedPackageDef$1(Typers.scala:5494)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed1(Typers.scala:5797)
    [error]     at scala.tools.nsc.typechecker.Typers$Typer.typed(Typers.scala:5886)
    [error]     at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.apply(Analyzer.scala:115)
    [error]     at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:452)
    [error]     at scala.tools.nsc.typechecker.Analyzer$typerFactory$TyperPhase.run(Analyzer.scala:104)
    [error]     at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1506)
    [error]     at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1490)
    [error]     at scala.tools.nsc.Global$Run.compileSources(Global.scala:1482)
    [error]     at scala.tools.nsc.Global$Run.compile(Global.scala:1614)
    [error]     at xsbt.CachedCompiler0.run(CompilerInterface.scala:130)
    [error]     at xsbt.CachedCompiler0.run(CompilerInterface.scala:105)
    [error]     at xsbt.CompilerInterface.run(CompilerInterface.scala:31)
    [error]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [error]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    [error]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [error]     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    [error]     at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
    [error]     at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
    [error]     at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
    [error]     at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
    [error]     at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
    [error]     at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
    [error]     at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
    [error]     at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
    [error]     at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
    [error]     at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
    [error]     at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
    [error]     at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
    [error]     at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
    [error]     at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
    [error]     at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
    [error]     at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
    [error]     at sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
    [error]     at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
    [error]     at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
    [error]     at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
    [error]     at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
    [error]     at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
    [error]     at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
    [error]     at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
    [error]     at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
    [error]     at scala.Function1.$anonfun$compose$1(Function1.scala:44)
    [error]     at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
    [error]     at sbt.std.Transform$$anon$4.work(System.scala:67)
    [error]     at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
    [error]     at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
    [error]     at sbt.Execute.work(Execute.scala:278)
    [error]     at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
    [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)
    [error] (Compile / compileIncremental) java.lang.NoClassDefFoundError: scala/collection/TraversableOnce

Solution

  • There are two issues in your code:

    1. Use library dependency as

      com.outworkers" %% "phantom-dsl" % "2.59.0
      
    2. Don't put then name of node in ContactPoints

      val connection: CassandraConnection = ContactPoints(List("scylla-node1", "scylla-node2", "scylla-node3")).keySpace("user_keyspace")
      

    You should pass the IP address of your nodes such as

    val connection: CassandraConnection = ContactPoints(List("172.18.0.2", "172.18.0.3", "172.18.0.4")).keySpace("user_keyspace")