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

Example code doesn't work [3.2.29 / Java 17 / scala 3.4.1] #10223

Open
King-Ozymandias opened this issue Apr 30, 2024 · 2 comments
Open

Example code doesn't work [3.2.29 / Java 17 / scala 3.4.1] #10223

King-Ozymandias opened this issue Apr 30, 2024 · 2 comments
Milestone

Comments

@King-Ozymandias
Copy link

King-Ozymandias commented Apr 30, 2024

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.

@King-Ozymandias
Copy link
Author

King-Ozymandias commented Apr 30, 2024

Might be related:
Launched under Metals (clicking on the run option above "main" method):

  • VSCodium:
    Version: 1.88.1
    Release: 24104
    Commit: 0d01a72525276e5e3771fe5851b9c83de0de1e2b
    Date: 2024-04-13T01:53:59.491Z
    Electron: 28.2.8
    ElectronBuildId: undefined
    Chromium: 120.0.6099.291
    Node.js: 18.18.2
    V8: 12.0.267.19-electron.0
    OS: Linux x64 6.1.0-20-amd64
  • Metals: v1.30.0

@King-Ozymandias
Copy link
Author

King-Ozymandias commented Apr 30, 2024

And while I'm being thorough, build.sbt:

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

@tglman tglman added this to the 3.2.x milestone May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants