scalate 不编译 tomcat 中的模板

发布于 2024-10-16 07:25:01 字数 8391 浏览 1 评论 0原文

我试图让 scalate 在 tomcat 下工作,但是当它尝试编译诈骗模板时它崩溃了。码头没问题。我对这个和 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)

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

I am trying to make scalate work under tomcat, but it crashes when it tries to compile the scaml templates. No problem with Jetty. I am new to this and tomcat in general. It seems also the scalatra-sbt prototype on github crashes, which makes me think it's tomcat not configured correctly.

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)

Any hint on how to make scalate compiler work under tomcat?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

灯下孤影 2024-10-23 07:25:01

您是否已将 scala-compiler.jar 与其他 jar 一起部署?

Do you have scala-compiler.jar deployed with the other jars?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文