jettyscalatrascalatra-sbt

java.lang.NoClassDefFoundError: org/eclipse/jetty/plus/webapp/PlusConfiguration


I was following the tutorial from the Scalatra docs, installed the Consript and Giter8 and initialized the project using g8 as described. However when I cannot start the Jetty container using container:start as I am getting following exception:

[error] (container:start) java.lang.NoClassDefFoundError: org/eclipse/jetty/plus/webapp/PlusConfiguration

I haven't made any changes to the project generated by Giter. The version of java and javac executables is 1.7.0_65 (Sun).

These are the library dependencies from build.scala:

  libraryDependencies ++= Seq(
    "org.scalatra" %% "scalatra" % ScalatraVersion,
    "org.scalatra" %% "scalatra-scalate" % ScalatraVersion,
    "org.scalatra" %% "scalatra-specs2" % ScalatraVersion % "test",
    "ch.qos.logback" % "logback-classic" % "1.0.6" % "runtime",
    "org.eclipse.jetty" % "jetty-webapp" % "9.1.3.v20140225" % "container",
    "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container;provided;test" artifacts (Artifact("javax.servlet", "jar", "jar"))
  )

Solution

  • I've got same problem and spent several hours to find out how to fix it. But nothing resulted. :( So I have to check out the Scalatra template.

    In https://github.com/scalatra/scalatra-sbt.g8, there a some modified build.scala at few days ago. the version of "jetty-webapp" was changed from "8.1.8.v20121106" to "9.1.3.v20140225".

    Then I modify version of jetty-webapp to previous version in my project's build.scala file and application runs well. :)

    I'll raise issue for this problem.

    Good luck.

    Added > the template patched now and container:start works fine. :)