Scalate 和 GAE 选项 org.fusesource.scalate.TemplateException:无法创建临时文件
我正在尝试在 Google 应用程序引擎上运行 Scala/Scalate。 我想测试该项目,所以我在本地运行 GAE 部署成功,当我尝试调用我得到的主网址时 以下异常
org.fusesource.scalate.TemplateException:无法创建临时的 文件 在 org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala: 第739章) 在 org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.sc 阿拉: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:56) 在 MyScalatraFilter.renderErrorPage(MyScalatraFilter.scala:5) 在 org.scalatra.scalate.ScalateSupport $class.handleError(ScalateSupport.scala:51) 在 MyScalatraFilter.handleError(MyScalatraFilter.scala:5) 在 org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply $mcV$sp$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(ScalatraKernel.scala: 140) 在 org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply $mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:134) 在 org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply $mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:134) 在 scala.util.DynamicVariable.withValue(DynamicVariable.scala: 71) 在 org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply $mcV$sp$1.应用$mcV$sp(ScalatraKernel.scala:134) 在 org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply $mcV$sp$1.apply(ScalatraKernel.scala:134) 在 org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply $mcV$sp$1.apply(ScalatraKernel.scala:134) 在 scala.util.DynamicVariable.withValue(DynamicVariable.scala: 71) 在 org.scalatra.ScalatraKernel$$anonfun$handle$1.apply$mcV $sp(ScalatraKernel.scala:133) 在 org.scalatra.ScalatraKernel$$anonfun$handle $1.apply(ScalatraKernel.scala:133) 在 org.scalatra.ScalatraKernel$$anonfun$handle $1.apply(ScalatraKernel.scala:133) 在 scala.util.DynamicVariable.withValue(DynamicVariable.scala: 71) 在 org.scalatra.ScalatraKernel $class.handle(ScalatraKernel.scala:132) 在 MyScalatraFilter.handle(MyScalatraFilter.scala:5) 在 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) 在 MyScalatraFilter.doFilter(MyScalatraFilter.scala:5) 在 org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(他 aderVerificationFilter.java:35) 在 org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFi 过滤器.java: 58) 在 org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans actionCleanupFilter.java: 43) 在 org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFile 过滤器.java: 122) 在 org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) 在 com.google.appengine.tools.development.BackendServersFilter.doFilter(后端 dServersFilter.java:97) 在 org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1157) 在 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 第388章) 在 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) 在 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 182) 在 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 第765章) 在 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) 在 com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEn gineWebAppContext.java: 70) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) 在 com.google.appengine.tools.development.JettyContainerService $ApiProxyHandler.handle(JettyContainerService.java:351) 在 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) 在 org.mortbay.jetty.Server.handle(Server.java:326) 在 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 第542章) 在 org.mortbay.jetty.HttpConnection $RequestHandler.headerComplete(HttpConnection.java:923) 在 org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
<前><代码>位于org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) 在 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) 在 org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 第409章) 在 org.mortbay.thread.QueuedThreadPool $PoolThread.run(QueuedThreadPool.java:582) 原因: java.lang.SecurityException:无法创建临时文件 在 java.io.File.checkAndCreate(File.java:1701) 在 java.io.File.createTempFile(File.java:1792) 在 java.io.File.createTempFile(File.java:1828) 在 org.fusesource.scalate.TemplateEngine.workingDirectory(TemplateEngine.scala :200) 在 org.fusesource.scalate.TemplateEngine.sourceDirectory(TemplateEngine.scala: 156) 在 org.fusesource.scalate.TemplateEngine.sourceFileName(TemplateEngine.scala: 第612章) 在 org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala: 第650章) ... 56 更多 2011 年 8 月 19 日下午 3:45:16 com.google.appengine.tools.development.LocalResourceFileServlet doGet 警告:未找到以下文件:/favicon.ico
有人帮助我解决这个问题吗?
I am trying to run Scala/Scalate on Google app engine.
I wanted to test the project so i am running the GAE locally its
deployed successfully and when i try to call the main url i am getting
following exception
org.fusesource.scalate.TemplateException: Unable to create temporary
file
at
org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:
739)
at
org.fusesource.scalate.TemplateEngine.compileAndLoadEntry(TemplateEngine.sc
ala: 595)
at
org.fusesource.scalate.TemplateEngine.liftedTree1$1(TemplateEngine.scala:
327)
at
org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:321)
at
org.fusesource.scalate.TemplateEngine.load(TemplateEngine.scala:391)
at org.scalatra.scalate.ScalateSupport
$class.renderErrorPage(ScalateSupport.scala:56)
at MyScalatraFilter.renderErrorPage(MyScalatraFilter.scala:5)
at org.scalatra.scalate.ScalateSupport
$class.handleError(ScalateSupport.scala:51)
at MyScalatraFilter.handleError(MyScalatraFilter.scala:5)
at
org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply
$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(ScalatraKernel.scala:
140)
at
org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply
$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:134)
at
org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply
$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:134)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:
71)
at
org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply
$mcV$sp$1.apply$mcV$sp(ScalatraKernel.scala:134)
at
org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply
$mcV$sp$1.apply(ScalatraKernel.scala:134)
at
org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply
$mcV$sp$1.apply(ScalatraKernel.scala:134)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:
71)
at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply$mcV
$sp(ScalatraKernel.scala:133)
at org.scalatra.ScalatraKernel$$anonfun$handle
$1.apply(ScalatraKernel.scala:133)
at org.scalatra.ScalatraKernel$$anonfun$handle
$1.apply(ScalatraKernel.scala:133)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:
71)
at org.scalatra.ScalatraKernel
$class.handle(ScalatraKernel.scala:132)
at MyScalatraFilter.handle(MyScalatraFilter.scala:5)
at org.scalatra.ScalatraFilter$$anonfun$doFilter$1.apply$mcV
$sp(ScalatraFilter.scala:18)
at org.scalatra.ScalatraFilter$$anonfun$doFilter
$1.apply(ScalatraFilter.scala:18)
at org.scalatra.ScalatraFilter$$anonfun$doFilter
$1.apply(ScalatraFilter.scala:18)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:
71)
at org.scalatra.ScalatraFilter
$class.doFilter(ScalatraFilter.scala:17)
at MyScalatraFilter.doFilter(MyScalatraFilter.scala:5)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.HeaderVerificationFilter.doFilter(He
aderVerificationFilter.java: 35)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFi
lter.java: 58)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(Trans
actionCleanupFilter.java: 43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFile
Filter.java: 122)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.BackendServersFilter.doFilter(Backen
dServersFilter.java: 97)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEn
gineWebAppContext.java: 70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at
com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:351)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: 212)
at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: 404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
409)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582) Caused by:
java.lang.SecurityException: Unable to create temporary file
at java.io.File.checkAndCreate(File.java:1701)
at java.io.File.createTempFile(File.java:1792)
at java.io.File.createTempFile(File.java:1828)
at
org.fusesource.scalate.TemplateEngine.workingDirectory(TemplateEngine.scala
: 200)
at
org.fusesource.scalate.TemplateEngine.sourceDirectory(TemplateEngine.scala:
156)
at
org.fusesource.scalate.TemplateEngine.sourceFileName(TemplateEngine.scala:
612)
at
org.fusesource.scalate.TemplateEngine.compileAndLoad(TemplateEngine.scala:
650)
... 56 more Aug 19, 2011 3:45:16 PM
com.google.appengine.tools.development.LocalResourceFileServlet doGet
WARNING: No file found for: /favicon.ico
Anyone help me on this issues ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
GAE 有一些多线程限制,scalate 用户指南包含有关 GAE 的注释以及示例项目的链接,指南链接
GAE has some multithreading restrictions, scalate user guide has notes about GAE with link to example project, link to guide
更具体地说,您需要预编译模板,如文档指定 。
To be more specific you need to precompile your templates, as the documentation specifies.