You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exception in thread "main" java.lang.ClassCastException: class com.orientechnologies.orient.core.db.record.ORecordLazySet cannot be cast to class scala.collection.immutable.Set (com.orientechnologies.orient.core.db.record.ORecordLazySet and scala.collection.immutable.Set are in unnamed module of loader 'app')
name := "<redacted>"
organization := "<redacted>"
version := "0.1-SNAPSHOT"
scalaVersion := "3.4.1"
libraryDependencies ++= Seq(
"org.scalafx" %% "scalafx" % "22.0.0-R33",
"org.scalatest" %% "scalatest" % "3.2.18" % "test",
"com.orientechnologies" % "orientdb-graphdb" % "3.2.29"
)
// Fork a new JVM for 'run' and 'test:run' to avoid JavaFX double initialization problems
fork := true
// set the main class for the main 'run' task
// change Compile to Test to set it for 'test:run'
Compile / run / mainClass := Some("<redacted>.ScalaFXHelloWorld")
OrientDB Version: 3.2.29
Java Version: 17 (build 17.0.11+9-Debian-1deb12u1, mixed mode, sharing)
OS: Linux 6.1.0-20-amd64#1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux
Scala: 3.4.1
Expected behavior
The Scala demo code (https://orientdb.com/docs/last/scala/Scala-Language.html) works
Actual behavior
The line
edge.getProperty("projects").asInstanceOf[Set[Vertex]].map(v=>v.getProperty[String]("name")).mkString(", ") else "Any"
errors out with:
Exception in thread "main" java.lang.ClassCastException: class com.orientechnologies.orient.core.db.record.ORecordLazySet cannot be cast to class scala.collection.immutable.Set (com.orientechnologies.orient.core.db.record.ORecordLazySet and scala.collection.immutable.Set are in unnamed module of loader 'app')
had to fix it as:
edge.getProperty("projects").asInstanceOf[ju.Set[Vertex]].asScala.map(v=>v.getProperty[String]("name")).mkString(", ") else "Any"
Steps to reproduce
Run the referenced example.
The text was updated successfully, but these errors were encountered: