这意味着什么异常“ dotc:错误的符号引用”

问题描述

我想使用 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。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...