1

When I attempt to deploy a Scala class to GAE I receive this error in the logs :

Uncaught exception from servlet java.lang.NoClassDefFoundError: scala/Predef$ at com.myapp.controller.FirstTest.getString(FirstTest.scala:7) at com.gogofindit.myapp.RedirectController.displaySearch(RedirectController.java:20)

The app works locally, its just when I deploy to app engine that I receive the error.

According to this doc Scala is supported : https://developers.google.com/appengine/docs/

Here is the Scala class :

class FirstTest {

  def getString = {

    println("In scala")

    "search"
  }

}

Do I need to update a config file within the project so that the Scala classes are compiled ?

4

1 回答 1

2

无需任何额外努力即可支持 Scala。但是应该在 pom.xml 或项目配置中将您的 scala 类添加到编译过程中(例如,通过在 Eclipse 中添加性质)。看看你是否可以在 bin/ 或 target/classes 中找到已编译的类,在 java 类旁边。

于 2013-07-10T21:47:58.387 回答