我正在使用 scalatra 文档和 sbt-assembly 插件来创建一个独立的 jar。它可以在我的本地机器(Debian Wheezy with OpenJdk 1.7.0)上运行,但在运行相同 Jdk 的远程 EC2 机器(Ubuntu 12.04.2 LTS)上失败。
异常消息是:
org.fusesource.scalate.util.ResourceNotFoundException: Could not load resource: [index.ssp]; are you sure it's within [/home/abc/src/main/webapp]?
at org.fusesource.scalate.servlet.ServletResourceLoader.createNotFoundException(ServletResourceLoader.scala:79)
at org.fusesource.scalate.util.ResourceLoader$class.resourceOrFail(ResourceLoader.scala:55)
at org.fusesource.scalate.servlet.ServletResourceLoader.resourceOrFail(ServletResourceLoader.scala:37)
at org.fusesource.scalate.util.UriResource.delegate(Resource.scala:91)
at org.fusesource.scalate.util.DelegateResource.text(Resource.scala:216)
at org.fusesource.scalate.ssp.SspCodeGenerator.generate(SspCodeGenerator.scala:152)
at org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:750)
at org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:699)
at org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:419)
它说它找不到视图,但完全相同的 jar 文件在我的本地计算机上工作。