You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scalatra-user
Hello,
I just started a simple exercise based on prototype application. The
prototype runs well with sbt and jetty. However, if its packaged as a
war and deployed in Tomcat, I keep getting this exception:
20-Apr-2011 7:34:25 PM org.apache.catalina.core.StandardContext
filterStart
SEVERE: Exception starting filter scalatra
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively(Native Method)
at java.io.File.checkAndCreate(File.java:1716)
at java.io.File.createTempFile(File.java:1804)
at java.io.File.createTempFile(File.java:1840)
at
org.fusesource.scalate.TemplateEngine.workingDirectory(TemplateEngine.scala:
240)
at
org.fusesource.scalate.servlet.ServletTemplateEngine.<init>(ServletTemplateEngine.scala:
108)
at org.scalatra.scalate.ScalateSupport$$anon
$2.<init>(ScalateSupport.scala:28)
at org.scalatra.scalate.ScalateSupport
$class.createTemplateEngine(ScalateSupport.scala:28)
at
com.ksi.lf.web.filter.MyScalatraFilter.createTemplateEngine(MyScalatraFilter.scala:
14)
at org.scalatra.scalate.ScalateSupport
$class.initialize(ScalateSupport.scala:20)
at
com.ksi.lf.web.filter.MyScalatraFilter.initialize(MyScalatraFilter.scala:
14)
at
com.ksi.lf.web.filter.MyScalatraFilter.initialize(MyScalatraFilter.scala:
14)
at org.scalatra.ScalatraFilter$class.init(ScalatraFilter.scala:33)
at com.ksi.lf.web.filter.MyScalatraFilter.init(MyScalatraFilter.scala:
14)
Has anyone run into this issue? I tried to change the temp directory
like so in the filter:
before {
contentType = "text/html"
templateEngine.workingDirectory = new File("~/tmp")
}
That still throws same exception. What am I doing wrong? Please
advise.
Regards,
Vijay
Ross A. Baker
unread,
Apr 20, 2011, 11:27:12 PM4/20/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to scalat...@googlegroups.com
The before filter doesn't work because the template engine is initialized in the constructor. You can set Scalate's working directory with the scalate.workdir system property.
As for why it doesn't work out of the box, my only guess is that you have an odd setting for the java.io.tempdir system property in Tomcat. Scalate's default is based on that.