【问题标题】:Bad symbolic reference to scala.ScalaObject对 scala.ScalaObject 的错误符号引用
【发布时间】:2014-08-20 04:58:44
【问题描述】:

我正在尝试为 Lift 框架启动基本 sbt 构建并遇到以下错误:

[error] bad symbolic reference to scala.ScalaObject encountered in class file 'package.class'.
[error] Cannot access type ScalaObject in package scala. The current classpath may be
[error] missing a definition for scala.ScalaObject, or package.class may have been compiled against a version that's
[error] incompatible with the one found on the current classpath.
[error] one error found
[error] (compile:compile) Compilation failed
[error] Total time: 7 s, completed Aug 19, 2014 8:27:51 PM

这是我的构建文件,在sbt 0.13下运行:

name := "MyApp"

version := "0.0.0"

organization := "com.myapp"

scalaVersion := "2.11.1"

EclipseKeys.createSrc := EclipseCreateSrc.Default + EclipseCreateSrc.Resource

resolvers ++= Seq("snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
                  "releases"  at "http://oss.sonatype.org/content/repositories/releases",
                  "releases"  at "http://oss.sonatype.org/content/repositories/releases"
                )

seq(webSettings :_*)

unmanagedResourceDirectories in Test <+= (baseDirectory) { _ / "src/main/webapp" }

scalacOptions ++= Seq("-deprecation", "-unchecked")

libraryDependencies ++= {
  val liftVersion = "2.6-RC1"
  Seq(
    "net.liftweb"       %% "lift-webkit"        % liftVersion        % "compile",
    "net.liftweb"       %% "lift-mapper"        % liftVersion        % "compile",
    "net.liftmodules"   % "lift-jquery-module_2.6_2.9.1-1" % "2.8",
    "org.eclipse.jetty" % "jetty-webapp"        % "9.2.2.v20140723"  % "container,test",
    "org.eclipse.jetty" % "jetty-plus"          % "9.2.2.v20140723"  % "container,test", // For Jetty Config
    "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container,test" artifacts Artifact("javax.servlet", "jar", "jar"),
    "org.specs2"        %% "specs2"             % "2.4.1"            % "test",
    "mysql" % "mysql-connector-java" % "5.1.+",
    "org.slf4j" % "slf4j-log4j12" % "1.7.+",
    "org.squeryl" % "squeryl_2.11" % "0.9.6-RC3"
  )
}

herehere 有类似的问题,但我不明白答案,他们并没有帮助我解决问题。我最近都升级到 Scala 2.11.1 并升级了在 sbt 中声明的依赖项,但我不确定问题到底出在哪里。我的具体问题是:如何从上面的错误跟踪到导致此问题的依赖项?或者,如果不是依赖问题,问题出在哪里,我如何确定问题出在哪里?

【问题讨论】:

    标签: sbt lift scala-2.11


    【解决方案1】:

    快速浏览一下,您可能正在使用 scala 2.9.1 版本的 Lift-JQuery。从他们的文档中:

    对于 >= 2.3 的版本

    "net.liftmodules" %% "moduleName_x1.y1 % "x2.y2[.z2][-SNAPSHOT/rcx/mx]"

    其中 x1.y1 是 Lift 主要和次要版本号,a.b.c 是 Scala 版本号和 x2.y2.[z2] 是模块的主要 x2,次要 y2 和 最终递增的数字 z2 后跟最终的 SNAPSHOT 发布候选 (rcX) 或里程碑 (mX) 版本部分。

    正在尝试:"net.liftmodules" % "lift-jquery-module_2.6" % "2.8" 可能会解决您的问题

    【讨论】:

    • 它确实解决了我的问题!谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-08
    • 2015-12-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-30
    • 2013-04-21
    相关资源
    最近更新 更多