scalate不会在tomcat中编译模板

时间:2011-02-04 18:07:44

标签: tomcat scala scalate

我正在尝试使用tomcat进行scalate工作,但是当它尝试编译scaml模板时崩溃了。 Jetty没问题。我是新手,一般都是tomcat。它似乎也是github崩溃上的scalatra-sbt原型,这让我觉得它没有正确配置tomcat。

org.fusesource.scalate.TemplateException: scala/tools/nsc/settings/ScalaSettings
    org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:738)
    org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:595)
    org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:327)
    org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:321)
    org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:391)
    org.scalatra.scalate.ScalateSupport$class.renderErrorPage(ScalateSupport.scala:50)
    com.example.MyScalatraFilter.renderErrorPage(MyScalatraFilter.scala:7)
    org.scalatra.scalate.ScalateSupport$class.handleError(ScalateSupport.scala:46)
    com.example.MyScalatraFilter.handleError(MyScalatraFilter.scala:7)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(ScalatraKernel.scala:109)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:100)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:100)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply$mcV$sp(ScalatraKernel.scala:99)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:99)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:99)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$class.handle(ScalatraKernel.scala:98)
    com.example.MyScalatraFilter.handle(MyScalatraFilter.scala:7)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply$mcV$sp(ScalatraFilter.scala:18)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply(ScalatraFilter.scala:18)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply(ScalatraFilter.scala:18)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraFilter$class.doFilter(ScalatraFilter.scala:17)
    com.example.MyScalatraFilter.doFilter(MyScalatraFilter.scala:7)

root cause

java.lang.NoClassDefFoundError: scala/tools/nsc/settings/ScalaSettings
    org.fusesource.scalate.support.ScalaCompiler$.create(ScalaCompiler.scala:170)
    org.fusesource.scalate.TemplateEngine.compiler(TemplateEngine.scala:154)
    org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:655)
    org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:595)
    org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:327)
    org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:321)
    org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:391)
    org.scalatra.scalate.ScalateSupport$class.renderErrorPage(ScalateSupport.scala:50)
    com.example.MyScalatraFilter.renderErrorPage(MyScalatraFilter.scala:7)
    org.scalatra.scalate.ScalateSupport$class.handleError(ScalateSupport.scala:46)
    com.example.MyScalatraFilter.handleError(MyScalatraFilter.scala:7)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(ScalatraKernel.scala:109)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:100)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:100)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply$mcV$sp(ScalatraKernel.scala:99)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:99)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:99)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$class.handle(ScalatraKernel.scala:98)
    com.example.MyScalatraFilter.handle(MyScalatraFilter.scala:7)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply$mcV$sp(ScalatraFilter.scala:18)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply(ScalatraFilter.scala:18)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply(ScalatraFilter.scala:18)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraFilter$class.doFilter(ScalatraFilter.scala:17)
    com.example.MyScalatraFilter.doFilter(MyScalatraFilter.scala:7)

root cause

java.lang.ClassNotFoundException: scala.tools.nsc.settings.ScalaSettings
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1484)
    org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1329)
    org.fusesource.scalate.support.ScalaCompiler$.create(ScalaCompiler.scala:170)
    org.fusesource.scalate.TemplateEngine.compiler(TemplateEngine.scala:154)
    org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:655)
    org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.scala:595)
    org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:327)
    org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:321)
    org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:391)
    org.scalatra.scalate.ScalateSupport$class.renderErrorPage(ScalateSupport.scala:50)
    com.example.MyScalatraFilter.renderErrorPage(MyScalatraFilter.scala:7)
    org.scalatra.scalate.ScalateSupport$class.handleError(ScalateSupport.scala:46)
    com.example.MyScalatraFilter.handleError(MyScalatraFilter.scala:7)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(ScalatraKernel.scala:109)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:100)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:100)
    org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:100)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply$mcV$sp(ScalatraKernel.scala:99)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:99)
    org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:99)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraKernel$class.handle(ScalatraKernel.scala:98)
    com.example.MyScalatraFilter.handle(MyScalatraFilter.scala:7)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply$mcV$sp(ScalatraFilter.scala:18)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply(ScalatraFilter.scala:18)
    org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply(ScalatraFilter.scala:18)
    scala.util.DynamicVariable.withValue(DynamicVariable.scala:71)
    org.scalatra.ScalatraFilter$class.doFilter(ScalatraFilter.scala:17)
    com.example.MyScalatraFilter.doFilter(MyScalatraFilter.scala:7)

有关如何在tomcat下使scalate编译器工作的任何提示?

1 个答案:

答案 0 :(得分:5)

你有scala-compiler.jar部署其他罐子吗?