2011-02-04 82 views
3

我想在tomcat下編譯scalate,但是它在嘗試編譯scaml模板時崩潰。 Jetty沒問題。一般來說,我對這個和tomcat都很陌生。它似乎也是github崩潰的scalatra-sbt原型,這使我認爲它的tomcat配置不正確。scalate不能在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編譯器工作?

+0

嗨,我想安裝在tomcat服務器的scalate,但我找不到任何資源解釋如何做到這一點。什麼罐子下載和從哪裏?在哪裏添加這些罐子?對web.xml文件的任何修改? 你能幫我解決這些問題嗎? – Eyal 2014-12-10 15:24:58

回答

5

您是否已將scala-compiler.jar與其他罐子一起部署?

+1

不,通過打包和部署它解決了我的問題。非常感謝你的幫助! – flagZ 2011-02-05 00:37:53