这个异常是什么意思 'dotc: Bad symbolic reference.'

What means this exception 'dotc: Bad symbolic reference.'

我想使用 Scala 3 并使用一些现有的库。该示例适用于 Scala 2.13。

编译时出现异常:

dotc: Bad symbolic reference. A signature in ../dmn-engine-1.4.0.jar(org/camunda/dmn/parser/ParsedDmn.class)
refers to Serializable/T in package scala which is not available.
It may be completely missing from the current classpath, or the version on
the classpath might be incompatible with the version used when compiling ../dmn-engine-1.4.0.jar(org/camunda/dmn/parser/ParsedDmn.class).

这是我的build.sbt

lazy val extension = project
  .in(file("extension"))
  .settings(scalaVersion := dottyVersion,
    libraryDependencies ++= Seq(
      ("org.camunda.bpm.extension.dmn.scala" % "dmn-engine" % "1.4.0").withDottyCompat(scalaVersion.value),
      "com.novocode" % "junit-interface" % "0.11" % "test",
      "org.scalatest" %% "scalatest" % "3.2.2" % Test
    ),

    scalacOptions ++= {
      if (isDotty.value) Seq("-source:3.0-migration") else Nil
    }
  )

更新 好的,它适用于 2.12,使用 2.13 我收到以下错误:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: scala/Serializable
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    ...
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
    Caused by: java.lang.ClassNotFoundException: scala.Serializable
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        ... 19 more

在弄清楚它只适用于 Scala 2.12 后,我发现了问题。

libraryDependencies "org.camunda.bpm.extension.dmn.scala" % "dmn-engine" % "1.4.0" 指的是 Scala 2.12。