どうやら、playが自動生成するファイルのクラス名が長すぎて、scalaコンパイラの扱う長さを超えてしまっていることが原因らしい。しかしscalacに渡すコンパイラオプションを指定することによって長い名前を許容することができる。 play frameworkの場合はSBTを使っているので、project/Build.scalaをつぎのように変更した。$ play ~compile ... [error] [error] while compiling: myproject/target/scala-2.10/src_managed/main/views/html/signup.template.scala [error] during phase: jvm [error] library version: version 2.10.0 [error] compiler version: version 2.10.0 [error] reconstructed args: -encoding utf8 -bootclasspath ... [error] [error] last tree to typer: Literal(Constant(play.api.templates.Html)) [error] symbol: null [error] symbol definition: null [error] tpe: Class(classOf[play.api.templates.Html]) [error] symbol owners: [error] context owners: anonymous class anonfun$f$1 -> package html [error] [error] == Enclosing template or block == ... [error] == Expanded type of tree == [error] [error] ConstantType(value = Constant(play.api.templates.Html)) [error] [error] uncaught exception during compilation: java.io.IOException [error] ファイル名が長すぎます [error] two errors found [error] (compile:compile) Compilation failed [error] Total time: 25 s, completed 2014/12/18 11:57:36 1. Waiting for source changes... (press enter to interrupt)
object ApplicationBuild extends Build {
...
val main = play.Project(appName, appVersion, appDependencies).settings(
scalacOptions ++= Seq("-Xmax-classfile-name", "140")
)
}
参考: https://github.com/scala/pickling/issues/10#issuecomment-31318136